from sys import stdin

input = stdin.readline



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



ans = "IMPOSSIBLE"



seta,setb = set(),set()

af,bf = [False]*M,[False]*M



for m in range(M):

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

    if a-1 == 0:

        af[m] = True

        seta.add(b-1)

    if b-1 == N-1:

        bf[m] = True

        setb.add(a-1)

    if af[m] and bf[m]:

        ans = "POSSIBLE"

        break

    

for a in seta:

    if ans == "POSSIBLE":

        break

    if a in setb:

        ans = "POSSIBLE"

        break



print(ans)
from sys import stdin

input = stdin.readline



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



ans = "IMPOSSIBLE"



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")

from sys import stdin

input = stdin.readline
N, M = list(map(int, (input().split())))
ans = "IMPOSSIBLE"
seta, setb = set(), set()
af, bf = [False] * M, [False] * M
for m in range(M):
    a, b = list(map(int, (input().split())))
    if a - 1 == 0:
        af[m] = True
        seta.add(b - 1)
    if b - 1 == N - 1:
        bf[m] = True
        setb.add(a - 1)
    if af[m] and bf[m]:
        ans = "POSSIBLE"
        break
for a in seta:
    if ans == "POSSIBLE":
        break
    if a in setb:
        ans = "POSSIBLE"
        break
print(ans)

from sys import stdin

input = stdin.readline
N, M = list(map(int, (input().split())))
ans = "IMPOSSIBLE"
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")

-af, bf = [False] * M, [False] * M -    if a - 1 == 0: -        af[m] = True -        seta.add(b - 1) -    if b - 1 == N - 1: -        bf[m] = True -        setb.add(a - 1) -    if af[m] and bf[m]: -        ans = "POSSIBLE" -        break -for a in seta: -    if ans == "POSSIBLE": -        break -    if a in setb: -        ans = "POSSIBLE" -        break -print(ans) +    if a == 1: +        seta.add(b) +    if b == N: +        setb.add(a) +if seta & setb: +    print("POSSIBLE") +else: +    print("IMPOSSIBLE")