n,m=list(map(int,input().split()));a=[]

for i in range(m):

  aa,bb=list(map(int,input().split()))

  if aa==1:a.append(bb)

  if bb==n:a.append(aa)

a.sort()

for i in range(len(a)-1):

  if a[i]==a[i+1]:print("POSSIBLE");exit()

print("IMPOSSIBLE")
n,m=list(map(int,input().split()))

s,t=set(),set()

for _ in range(m):

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

  if a==1:t.add(b)

  if b==n:s.add(a)

if s&t:print("POSSIBLE")

else:print("IMPOSSIBLE")
n, m = list(map(int, input().split()))
a = []
for i in range(m):
    aa, bb = list(map(int, input().split()))
    if aa == 1:
        a.append(bb)
    if bb == n:
        a.append(aa)
a.sort()
for i in range(len(a) - 1):
    if a[i] == a[i + 1]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
s, t = set(), set()
for _ in range(m):
    a, b = list(map(int, input().split()))
    if a == 1:
        t.add(b)
    if b == n:
        s.add(a)
if s & t:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-a = [] -for i in range(m): -    aa, bb = list(map(int, input().split())) -    if aa == 1: -        a.append(bb) -    if bb == n: -        a.append(aa) -a.sort() -for i in range(len(a) - 1): -    if a[i] == a[i + 1]: -        print("POSSIBLE") -        exit() -print("IMPOSSIBLE") +s, t = set(), set() +for _ in range(m): +    a, b = list(map(int, input().split())) +    if a == 1: +        t.add(b) +    if b == n: +        s.add(a) +if s & t: +    print("POSSIBLE") +else: +    print("IMPOSSIBLE")