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

l1 = [0]*n

l2 = [0]*n



for i in range(m):

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

  a, b = a-1, b-1

  if a == 0:

    l1[b] = 1

  elif b == n-1:

    l2[a] = 1

  else:

    continue



for j in range(n):

  if l1[j] == 1 and l2[j] == 1:

    print('POSSIBLE')

    exit()

else:

  print('IMPOSSIBLE')

  

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

S = set()

for i in range(m):

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

    a, b = a-1, b-1

    S.add((a, b))



for i in range(1, n-1):

    if (0, i) in S and (i, n-1) in S:

        print('POSSIBLE')

        exit()

else:

    print('IMPOSSIBLE')

n, m = list(map(int, input().split()))
l1 = [0] * n
l2 = [0] * n
for i in range(m):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    if a == 0:
        l1[b] = 1
    elif b == n - 1:
        l2[a] = 1
    else:
        continue
for j in range(n):
    if l1[j] == 1 and l2[j] == 1:
        print("POSSIBLE")
        exit()
else:
    print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
S = set()
for i in range(m):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    S.add((a, b))
for i in range(1, n - 1):
    if (0, i) in S and (i, n - 1) in S:
        print("POSSIBLE")
        exit()
else:
    print("IMPOSSIBLE")

-l1 = [0] * n -l2 = [0] * n +S = set() -    if a == 0: -        l1[b] = 1 -    elif b == n - 1: -        l2[a] = 1 -    else: -        continue -for j in range(n): -    if l1[j] == 1 and l2[j] == 1: +    S.add((a, b)) +for i in range(1, n - 1): +    if (0, i) in S and (i, n - 1) in S: