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

p=tuple(tuple(map(int,input().split())) for _ in range (m))

s=set()

t=set()

for i in range(m):

    if 1 in p[i]:

        s.add(p[i][0])

        s.add(p[i][1])

    if n in p[i]:

        t.add(p[i][0])

        t.add(p[i][1])

res=s&t

if res:

    print("POSSIBLE")

else:

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

s=set()

t=set()

for _ in range (m):

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

  if a==1:

    s.add(b)

  if b==n:

    t.add(a)



res=s&t

if res:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")
n, m = list(map(int, input().split()))
p = tuple(tuple(map(int, input().split())) for _ in range(m))
s = set()
t = set()
for i in range(m):
    if 1 in p[i]:
        s.add(p[i][0])
        s.add(p[i][1])
    if n in p[i]:
        t.add(p[i][0])
        t.add(p[i][1])
res = s & t
if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

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

-p = tuple(tuple(map(int, input().split())) for _ in range(m)) -for i in range(m): -    if 1 in p[i]: -        s.add(p[i][0]) -        s.add(p[i][1]) -    if n in p[i]: -        t.add(p[i][0]) -        t.add(p[i][1]) +for _ in range(m): +    a, b = list(map(int, input().split())) +    if a == 1: +        s.add(b) +    if b == n: +        t.add(a)