import sys

input = sys.stdin.readline





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



edges = [set() for _ in range(n)]

for _ in range(m):

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

    edges[_from-1].add(to-1)



first = list(edges[0])



possible = False

while first:

    island = first.pop()

    if n-1 in edges[island]:

        possible = True

        break



if possible:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE ")

import sys

buf = sys.stdin.buffer



n, m = list(map(int, buf.readline().split()))

AB = list(map(int, buf.read().split()))



reachable_from_start = set()

reachable_to_goal = set()

for a, b in zip(AB,AB):

    if a == 1:

        reachable_from_start.add(b)

    if b == n:

        reachable_to_goal.add(a)



possible = reachable_from_start & reachable_to_goal

if possible or n in reachable_from_start:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")

import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
edges = [set() for _ in range(n)]
for _ in range(m):
    _from, to = list(map(int, input().split()))
    edges[_from - 1].add(to - 1)
first = list(edges[0])
possible = False
while first:
    island = first.pop()
    if n - 1 in edges[island]:
        possible = True
        break
if possible:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE ")

import sys

buf = sys.stdin.buffer
n, m = list(map(int, buf.readline().split()))
AB = list(map(int, buf.read().split()))
reachable_from_start = set()
reachable_to_goal = set()
for a, b in zip(AB, AB):
    if a == 1:
        reachable_from_start.add(b)
    if b == n:
        reachable_to_goal.add(a)
possible = reachable_from_start & reachable_to_goal
if possible or n in reachable_from_start:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-input = sys.stdin.readline -n, m = list(map(int, input().split())) -edges = [set() for _ in range(n)] -for _ in range(m): -    _from, to = list(map(int, input().split())) -    edges[_from - 1].add(to - 1) -first = list(edges[0]) -possible = False -while first: -    island = first.pop() -    if n - 1 in edges[island]: -        possible = True -        break -if possible: +buf = sys.stdin.buffer +n, m = list(map(int, buf.readline().split())) +AB = list(map(int, buf.read().split())) +reachable_from_start = set() +reachable_to_goal = set() +for a, b in zip(AB, AB): +    if a == 1: +        reachable_from_start.add(b) +    if b == n: +        reachable_to_goal.add(a) +possible = reachable_from_start & reachable_to_goal +if possible or n in reachable_from_start: -    print("IMPOSSIBLE ") +    print("IMPOSSIBLE")