import sys

sdin = sys.stdin.readline



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

AB = []

for i in range(M):

    AB.append(tuple(map(int, sdin().split())))

    

to_mid = set()

from_mid = set()



for a,b in AB:

    if a==1:

        to_mid.add(b)

    if b==N:

        from_mid.add(a)

        

if to_mid & from_mid:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")

import sys

stdin = sys.stdin



def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x)-1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())



n,m = li()



from1 = set()

toN = set()



for _ in range(m):

    a,b = li()

    if a==1:

        from1.add(b)

    elif b==1:

        from1.add(a)

        

    elif a==n:

        toN.add(b)

    elif b==n:

        toN.add(a)



if from1 & toN:

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")
import sys

sdin = sys.stdin.readline
N, M = list(map(int, sdin().split()))
AB = []
for i in range(M):
    AB.append(tuple(map(int, sdin().split())))
to_mid = set()
from_mid = set()
for a, b in AB:
    if a == 1:
        to_mid.add(b)
    if b == N:
        from_mid.add(a)
if to_mid & from_mid:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

import sys

stdin = sys.stdin


def li():
    return list(map(int, stdin.readline().split()))


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return list(map(float, stdin.readline().split()))


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(stdin.readline())


def nf():
    return float(stdin.readline())


n, m = li()
from1 = set()
toN = set()
for _ in range(m):
    a, b = li()
    if a == 1:
        from1.add(b)
    elif b == 1:
        from1.add(a)
    elif a == n:
        toN.add(b)
    elif b == n:
        toN.add(a)
if from1 & toN:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-sdin = sys.stdin.readline -N, M = list(map(int, sdin().split())) -AB = [] -for i in range(M): -    AB.append(tuple(map(int, sdin().split()))) -to_mid = set() -from_mid = set() -for a, b in AB: +stdin = sys.stdin + + +def li(): +    return list(map(int, stdin.readline().split())) + + +def li_(): +    return [int(x) - 1 for x in stdin.readline().split()] + + +def lf(): +    return list(map(float, stdin.readline().split())) + + +def ls(): +    return stdin.readline().split() + + +def ns(): +    return stdin.readline().rstrip() + + +def lc(): +    return list(ns()) + + +def ni(): +    return int(stdin.readline()) + + +def nf(): +    return float(stdin.readline()) + + +n, m = li() +from1 = set() +toN = set() +for _ in range(m): +    a, b = li() -        to_mid.add(b) -    if b == N: -        from_mid.add(a) -if to_mid & from_mid: +        from1.add(b) +    elif b == 1: +        from1.add(a) +    elif a == n: +        toN.add(b) +    elif b == n: +        toN.add(a) +if from1 & toN: