from collections import deque



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



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



for _ in range(M):

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

    a -= 1

    b -= 1

    edges[a].append(b)

    edges[b].append(a)



def dfs(start, end):

    minDist = [-1 for _ in range(N)]

    minDist[start] = 0



    que = deque([])

    que.append((start, 0))



    while que:

        now, dist = que.popleft()



        minDist[now] = dist

        if now == end:

            return dist



        for to in edges[now]:

            if minDist[to] >= 0:

                continue

            que.append((to, dist + 1))



    return float('inf')



if dfs(0, N - 1) <= 2:

    print('POSSIBLE')

else:

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



edges =[set() for _ in range(N + 1)]

one = set()

for _ in range(M):

    fr, to = list(map(int, input().split()))

    edges[fr].add(to)

    edges[to].add(fr)

    if fr == 1:

        one.add(to)

    if to == 1:

        one.add(fr)



for fr in one:

    if N in edges[fr]:

        print('POSSIBLE')

        exit()



print('IMPOSSIBLE')

from collections import deque

N, M = list(map(int, input().split()))
edges = [[] for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)


def dfs(start, end):
    minDist = [-1 for _ in range(N)]
    minDist[start] = 0
    que = deque([])
    que.append((start, 0))
    while que:
        now, dist = que.popleft()
        minDist[now] = dist
        if now == end:
            return dist
        for to in edges[now]:
            if minDist[to] >= 0:
                continue
            que.append((to, dist + 1))
    return float("inf")


if dfs(0, N - 1) <= 2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
edges = [set() for _ in range(N + 1)]
one = set()
for _ in range(M):
    fr, to = list(map(int, input().split()))
    edges[fr].add(to)
    edges[to].add(fr)
    if fr == 1:
        one.add(to)
    if to == 1:
        one.add(fr)
for fr in one:
    if N in edges[fr]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

-from collections import deque - -edges = [[] for _ in range(N)] +edges = [set() for _ in range(N + 1)] +one = set() -    a, b = list(map(int, input().split())) -    a -= 1 -    b -= 1 -    edges[a].append(b) -    edges[b].append(a) - - -def dfs(start, end): -    minDist = [-1 for _ in range(N)] -    minDist[start] = 0 -    que = deque([]) -    que.append((start, 0)) -    while que: -        now, dist = que.popleft() -        minDist[now] = dist -        if now == end: -            return dist -        for to in edges[now]: -            if minDist[to] >= 0: -                continue -            que.append((to, dist + 1)) -    return float("inf") - - -if dfs(0, N - 1) <= 2: -    print("POSSIBLE") -else: -    print("IMPOSSIBLE") +    fr, to = list(map(int, input().split())) +    edges[fr].add(to) +    edges[to].add(fr) +    if fr == 1: +        one.add(to) +    if to == 1: +        one.add(fr) +for fr in one: +    if N in edges[fr]: +        print("POSSIBLE") +        exit() +print("IMPOSSIBLE")