N, M, *A = list(map(int, open(0).read().split()))

A = [(A[i], A[i+1]) for i in range(0, M*2, 2)]

E = [[] for _ in range(N)]

for a, b in A:

    a -= 1; b -= 1

    E[a].append(b)

    E[b].append(a)



def search(d=2, v=0, g=N-1):

    if d == 0:

        if v == g:

            return True

        else:

            return False



    for to in E[v]:

        if search(d-1, to, g):

            return True

    return False



if search():

    print('POSSIBLE')

else:

    print('IMPOSSIBLE')
import sys

input = sys.stdin.readline

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

G = [[] for _ in [0]*N]

for _ in [0]*M:

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

    a -= 1; b -= 1

    G[a].append(b)

    G[b].append(a)



for v in G[0]:

    if N-1 in G[v]:

        print('POSSIBLE')

        break

else:

    print('IMPOSSIBLE')
N, M, *A = list(map(int, open(0).read().split()))
A = [(A[i], A[i + 1]) for i in range(0, M * 2, 2)]
E = [[] for _ in range(N)]
for a, b in A:
    a -= 1
    b -= 1
    E[a].append(b)
    E[b].append(a)


def search(d=2, v=0, g=N - 1):
    if d == 0:
        if v == g:
            return True
        else:
            return False
    for to in E[v]:
        if search(d - 1, to, g):
            return True
    return False


if search():
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

import sys

input = sys.stdin.readline
N, M = list(map(int, input().split()))
G = [[] for _ in [0] * N]
for _ in [0] * M:
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    G[a].append(b)
    G[b].append(a)
for v in G[0]:
    if N - 1 in G[v]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

-N, M, *A = list(map(int, open(0).read().split())) -A = [(A[i], A[i + 1]) for i in range(0, M * 2, 2)] -E = [[] for _ in range(N)] -for a, b in A: +import sys + +input = sys.stdin.readline +N, M = list(map(int, input().split())) +G = [[] for _ in [0] * N] +for _ in [0] * M: +    a, b = list(map(int, input().split())) -    E[a].append(b) -    E[b].append(a) - - -def search(d=2, v=0, g=N - 1): -    if d == 0: -        if v == g: -            return True -        else: -            return False -    for to in E[v]: -        if search(d - 1, to, g): -            return True -    return False - - -if search(): -    print("POSSIBLE") +    G[a].append(b) +    G[b].append(a) +for v in G[0]: +    if N - 1 in G[v]: +        print("POSSIBLE") +        break