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

f=set()

t=set()

for i in range(M):

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

  if a<2:

    f.add(b)

  if b==N:

    t.add(a)

print(("IM"*(len(f&t)^1)+"POSSIBLE"))
import sys

readline = sys.stdin.readline



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

G = [[] for i in range(N)]



for i in range(M):

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

  G[a - 1].append(b - 1)

  G[b - 1].append(a - 1)

  

for child in G[0]:

  for gchild in G[child]:

    if gchild == N - 1:

      print("POSSIBLE")

      exit(0)

print("IMPOSSIBLE")  
N, M = list(map(int, input().split()))
f = set()
t = set()
for i in range(M):
    a, b = list(map(int, input().split()))
    if a < 2:
        f.add(b)
    if b == N:
        t.add(a)
print(("IM" * (len(f & t) ^ 1) + "POSSIBLE"))

import sys

readline = sys.stdin.readline
N, M = list(map(int, readline().split()))
G = [[] for i in range(N)]
for i in range(M):
    a, b = list(map(int, readline().split()))
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)
for child in G[0]:
    for gchild in G[child]:
        if gchild == N - 1:
            print("POSSIBLE")
            exit(0)
print("IMPOSSIBLE")

-N, M = list(map(int, input().split())) -f = set() -t = set() +import sys + +readline = sys.stdin.readline +N, M = list(map(int, readline().split())) +G = [[] for i in range(N)] -    a, b = list(map(int, input().split())) -    if a < 2: -        f.add(b) -    if b == N: -        t.add(a) -print(("IM" * (len(f & t) ^ 1) + "POSSIBLE")) +    a, b = list(map(int, readline().split())) +    G[a - 1].append(b - 1) +    G[b - 1].append(a - 1) +for child in G[0]: +    for gchild in G[child]: +        if gchild == N - 1: +            print("POSSIBLE") +            exit(0) +print("IMPOSSIBLE")