# -*- coding: utf-8 -*-



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

abM = [list(map(int, input().split())) for i in range(M)]



transit = []

transit2 = []

for i in range(M):

    if abM[i][0] == 1:

        transit.append(abM[i][1])

    if abM[i][1] == N:

        transit2.append(abM[i][0])



# setで共通要素の集合を取ってみる

if len(set(transit) & set(transit2)) != 0:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")
# -*- coding: utf-8 -*-



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



# 1からある島への便があるかを保持

transit = [False] * N

# ある島からNへの便があるかを保持

transit2 = [False] * N



for i in range(M):

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

    if a == 1:

        transit[b] = True

    if b == N:

        transit2[a] = True



for i in range(N):

    if transit[i] and transit2[i]:

        print("POSSIBLE")

        exit()

print("IMPOSSIBLE")
# -*- coding: utf-8 -*-
N, M = list(map(int, input().split()))
abM = [list(map(int, input().split())) for i in range(M)]
transit = []
transit2 = []
for i in range(M):
    if abM[i][0] == 1:
        transit.append(abM[i][1])
    if abM[i][1] == N:
        transit2.append(abM[i][0])
# setで共通要素の集合を取ってみる
if len(set(transit) & set(transit2)) != 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

# -*- coding: utf-8 -*-
N, M = list(map(int, input().split()))
# 1からある島への便があるかを保持
transit = [False] * N
# ある島からNへの便があるかを保持
transit2 = [False] * N
for i in range(M):
    a, b = list(map(int, input().split()))
    if a == 1:
        transit[b] = True
    if b == N:
        transit2[a] = True
for i in range(N):
    if transit[i] and transit2[i]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

-abM = [list(map(int, input().split())) for i in range(M)] -transit = [] -transit2 = [] +# 1からある島への便があるかを保持 +transit = [False] * N +# ある島からNへの便があるかを保持 +transit2 = [False] * N -    if abM[i][0] == 1: -        transit.append(abM[i][1]) -    if abM[i][1] == N: -        transit2.append(abM[i][0]) -# setで共通要素の集合を取ってみる -if len(set(transit) & set(transit2)) != 0: -    print("POSSIBLE") -else: -    print("IMPOSSIBLE") +    a, b = list(map(int, input().split())) +    if a == 1: +        transit[b] = True +    if b == N: +        transit2[a] = True +for i in range(N): +    if transit[i] and transit2[i]: +        print("POSSIBLE") +        exit() +print("IMPOSSIBLE")