from collections import defaultdict

N,M=list(map(int,input().split()))

dict=defaultdict(int)

l1=[]

l2=[]

for i in range(M):

    a,b=list(map(int,input().split()))

    if a==1:

        l1.append(b)

    if b==N:

        dict[a]=1

for i in l1:

    if dict[i]:

        print("POSSIBLE")

        quit()

print("IMPOSSIBLE")



N,M=list(map(int,input().split()))

t=set()

s=set()

for i in range(M):

    a,b=list(map(int,input().split()))

    if a==1:

        s.add(b)

    if b==N:

        t.add(a)

for i in s:

    if i in t:

        print("POSSIBLE")

        quit()

print("IMPOSSIBLE")

from collections import defaultdict

N, M = list(map(int, input().split()))
dict = defaultdict(int)
l1 = []
l2 = []
for i in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        l1.append(b)
    if b == N:
        dict[a] = 1
for i in l1:
    if dict[i]:
        print("POSSIBLE")
        quit()
print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
t = set()
s = set()
for i in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        s.add(b)
    if b == N:
        t.add(a)
for i in s:
    if i in t:
        print("POSSIBLE")
        quit()
print("IMPOSSIBLE")

-from collections import defaultdict - -dict = defaultdict(int) -l1 = [] -l2 = [] +t = set() +s = set() -        l1.append(b) +        s.add(b) -        dict[a] = 1 -for i in l1: -    if dict[i]: +        t.add(a) +for i in s: +    if i in t: