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

ab = [tuple(map(int, input().split())) for _ in range(M)]

one_to_other = set([b for a, b in ab if a == 1])

other_to_n = set([a for a, b in ab if b == N])



way = one_to_other & other_to_n

if len(way) >= 1:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")

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

first = set()

second = set()



for i in range(M):

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

  if a == 1:

    first.add(b)

  if b == N:

    second.add(a)



if first & second:

  print("POSSIBLE")

else:

  print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
ab = [tuple(map(int, input().split())) for _ in range(M)]
one_to_other = set([b for a, b in ab if a == 1])
other_to_n = set([a for a, b in ab if b == N])
way = one_to_other & other_to_n
if len(way) >= 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
first = set()
second = set()
for i in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        first.add(b)
    if b == N:
        second.add(a)
if first & second:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-ab = [tuple(map(int, input().split())) for _ in range(M)] -one_to_other = set([b for a, b in ab if a == 1]) -other_to_n = set([a for a, b in ab if b == N]) -way = one_to_other & other_to_n -if len(way) >= 1: +first = set() +second = set() +for i in range(M): +    a, b = list(map(int, input().split())) +    if a == 1: +        first.add(b) +    if b == N: +        second.add(a) +if first & second: