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

g = [[] for _ in range(n)]



for i in range(m):

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

  a, b = a-1, b-1

  g[a].append(b)

  g[b].append(a)

  

from collections import deque

queue = deque([])

queue.append(0)



visited = [-1]*n

visited[0] = 0



while queue:

  x = queue.popleft()

  for new_x in g[x]:

    if visited[new_x] == -1:

      if new_x == n-1 and visited[x]+1 == 2:

        print('POSSIBLE')

        exit()

      else:

        visited[new_x] = visited[x]+1

        queue.append(new_x)

    else:

      continue

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()))
g = [[] for _ in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    g[a].append(b)
    g[b].append(a)
from collections import deque

queue = deque([])
queue.append(0)
visited = [-1] * n
visited[0] = 0
while queue:
    x = queue.popleft()
    for new_x in g[x]:
        if visited[new_x] == -1:
            if new_x == n - 1 and visited[x] + 1 == 2:
                print("POSSIBLE")
                exit()
            else:
                visited[new_x] = visited[x] + 1
                queue.append(new_x)
        else:
            continue
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")

-g = [[] for _ in range(n)] +l1 = [0] * n +l2 = [0] * n -    g[a].append(b) -    g[b].append(a) -from collections import deque - -queue = deque([]) -queue.append(0) -visited = [-1] * n -visited[0] = 0 -while queue: -    x = queue.popleft() -    for new_x in g[x]: -        if visited[new_x] == -1: -            if new_x == n - 1 and visited[x] + 1 == 2: -                print("POSSIBLE") -                exit() -            else: -                visited[new_x] = visited[x] + 1 -                queue.append(new_x) -        else: -            continue -print("IMPOSSIBLE") +    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")