import fileinput



input = fileinput.input().readline



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



seta,setb = set(),set()



for m in range(M):

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

    if a == 1:

        seta.add(b)

    if b == N:

        setb.add(a)

        

if seta & setb:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")
import sys

lines = sys.stdin.readlines()

N,M = list(map(int,(lines[0].split())))

seta,setb = set(),set()

for m in range(1,M+1):

    a,b = list(map(int,(lines[m].split())))

    if a == 1:

        seta.add(b)

    if b == N:

        setb.add(a)        

if seta & setb:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")
import fileinput

input = fileinput.input().readline
N, M = list(map(int, (input().split())))
seta, setb = set(), set()
for m in range(M):
    a, b = list(map(int, (input().split())))
    if a == 1:
        seta.add(b)
    if b == N:
        setb.add(a)
if seta & setb:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

import sys

lines = sys.stdin.readlines()
N, M = list(map(int, (lines[0].split())))
seta, setb = set(), set()
for m in range(1, M + 1):
    a, b = list(map(int, (lines[m].split())))
    if a == 1:
        seta.add(b)
    if b == N:
        setb.add(a)
if seta & setb:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-import fileinput +import sys -input = fileinput.input().readline -N, M = list(map(int, (input().split()))) +lines = sys.stdin.readlines() +N, M = list(map(int, (lines[0].split()))) -for m in range(M): -    a, b = list(map(int, (input().split()))) +for m in range(1, M + 1): +    a, b = list(map(int, (lines[m].split())))