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

g = {i: set() for i in range(1, N + 1)}

for _ in range(M):

    A, B = list(map(int, input().split()))

    g[A].add(B)

    g[B].add(A)



if g[1].intersection(g[N]):

    print('POSSIBLE')

else:

    print('IMPOSSIBLE')

import sys





def input():

    return sys.stdin.readline().strip()





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

g = {i: set() for i in range(1, N + 1)}

for _ in range(M):

    A, B = list(map(int, input().split()))

    if A in (1, N) or B in (1, N):

        g[A].add(B)

        g[B].add(A)



if g[1].intersection(g[N]):

    print('POSSIBLE')

else:

    print('IMPOSSIBLE')

N, M = list(map(int, input().split()))
g = {i: set() for i in range(1, N + 1)}
for _ in range(M):
    A, B = list(map(int, input().split()))
    g[A].add(B)
    g[B].add(A)
if g[1].intersection(g[N]):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

import sys


def input():
    return sys.stdin.readline().strip()


N, M = list(map(int, input().split()))
g = {i: set() for i in range(1, N + 1)}
for _ in range(M):
    A, B = list(map(int, input().split()))
    if A in (1, N) or B in (1, N):
        g[A].add(B)
        g[B].add(A)
if g[1].intersection(g[N]):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

+import sys + + +def input(): +    return sys.stdin.readline().strip() + + -    g[A].add(B) -    g[B].add(A) +    if A in (1, N) or B in (1, N): +        g[A].add(B) +        g[B].add(A)