import sys

from collections import deque



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



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

for _ in range(M):

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

    paths[a].append(b)

    paths[b].append(a)



q = deque([(1, 0)])

visited = set()

while q:

    p, c = q.popleft()

    if p in visited:

        continue

    visited.add(p)

    if c > 2:

        continue

    if p == N:

        print("POSSIBLE")

        sys.exit()

    for next_p in paths[p]:

        q.append((next_p, c+1))



print("IMPOSSIBLE")
import sys



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



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

for _ in range(M):

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

    paths[a].append(b)

    paths[b].append(a)



for i in paths[1]:

    for j in paths[i]:

        if j == N:

            print("POSSIBLE")

            sys.exit()

print("IMPOSSIBLE")
import sys
from collections import deque

N, M = list(map(int, sys.stdin.readline().strip().split()))
paths = [[] for _ in range(N + 1)]
for _ in range(M):
    a, b = list(map(int, sys.stdin.readline().strip().split()))
    paths[a].append(b)
    paths[b].append(a)
q = deque([(1, 0)])
visited = set()
while q:
    p, c = q.popleft()
    if p in visited:
        continue
    visited.add(p)
    if c > 2:
        continue
    if p == N:
        print("POSSIBLE")
        sys.exit()
    for next_p in paths[p]:
        q.append((next_p, c + 1))
print("IMPOSSIBLE")

import sys

N, M = list(map(int, sys.stdin.readline().strip().split()))
paths = [[] for _ in range(N + 1)]
for _ in range(M):
    a, b = list(map(int, sys.stdin.readline().strip().split()))
    paths[a].append(b)
    paths[b].append(a)
for i in paths[1]:
    for j in paths[i]:
        if j == N:
            print("POSSIBLE")
            sys.exit()
print("IMPOSSIBLE")

-from collections import deque -q = deque([(1, 0)]) -visited = set() -while q: -    p, c = q.popleft() -    if p in visited: -        continue -    visited.add(p) -    if c > 2: -        continue -    if p == N: -        print("POSSIBLE") -        sys.exit() -    for next_p in paths[p]: -        q.append((next_p, c + 1)) +for i in paths[1]: +    for j in paths[i]: +        if j == N: +            print("POSSIBLE") +            sys.exit()