#!/usr/bin/env python3

from collections import deque



n, m = list(map(int, input().split()))

graph = [deque([]) for _ in range(n + 1)]

for _ in range(m):

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

    graph[a].append(b)

    graph[b].append(a)

for i in graph[1]:

    if n in graph[i]:

        print("POSSIBLE")

        exit()

print("IMPOSSIBLE")

#!/usr/bin/env python3

n, m = input().split()

a = set()

b = set()

for _ in range(int(m)):

    r = set(input().split())

    if "1" in r:

        a |= r

    if n in r:

        b |= r

print(("POSSIBLE" if len(a & b) > 0 else "IMPOSSIBLE"))

#!/usr/bin/env python3
from collections import deque

n, m = list(map(int, input().split()))
graph = [deque([]) for _ in range(n + 1)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    graph[a].append(b)
    graph[b].append(a)
for i in graph[1]:
    if n in graph[i]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

#!/usr/bin/env python3
n, m = input().split()
a = set()
b = set()
for _ in range(int(m)):
    r = set(input().split())
    if "1" in r:
        a |= r
    if n in r:
        b |= r
print(("POSSIBLE" if len(a & b) > 0 else "IMPOSSIBLE"))

-from collections import deque - -n, m = list(map(int, input().split())) -graph = [deque([]) for _ in range(n + 1)] -for _ in range(m): -    a, b = list(map(int, input().split())) -    graph[a].append(b) -    graph[b].append(a) -for i in graph[1]: -    if n in graph[i]: -        print("POSSIBLE") -        exit() -print("IMPOSSIBLE") +n, m = input().split() +a = set() +b = set() +for _ in range(int(m)): +    r = set(input().split()) +    if "1" in r: +        a |= r +    if n in r: +        b |= r +print(("POSSIBLE" if len(a & b) > 0 else "IMPOSSIBLE"))