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

ab=[list(map(int,input().split())) for i in range(m)]



ninoshima=[[0]*(n+1) for i in range(2)]



for i in range(m):

    if ab[i][0]==1:

        ninoshima[0][ab[i][1]]=1

    if ab[i][1]==n:

        ninoshima[1][ab[i][0]]=1

    



for i in range(n+1):

    if ninoshima[0][i]==ninoshima[1][i]==1:

        print("POSSIBLE")

        quit()



print("IMPOSSIBLE")
import bisect

import copy

import heapq

import math

import sys

from collections import *

from functools import lru_cache

from itertools import accumulate, combinations, permutations, product

def input():

    return sys.stdin.readline()[:-1]

def ruiseki(lst):

    return [0]+list(accumulate(lst))

sys.setrecursionlimit(500000)

mod=pow(10,9)+7

al=[chr(ord('a') + i) for i in range(26)]

direction=[[1,0],[0,1],[-1,0],[0,-1]]



dic={}



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

ab=[list(map(int,input().split())) for i in range(m)]



for i in range(m):

    a,b=ab[i]

    if a==1:

        dic[b]=1



# print(dic)

for i in range(m):

    a,b=ab[i]

    if b==n and a in dic:

        print("POSSIBLE")

        break

else:

    print("IMPOSSIBLE")
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]
ninoshima = [[0] * (n + 1) for i in range(2)]
for i in range(m):
    if ab[i][0] == 1:
        ninoshima[0][ab[i][1]] = 1
    if ab[i][1] == n:
        ninoshima[1][ab[i][0]] = 1
for i in range(n + 1):
    if ninoshima[0][i] == ninoshima[1][i] == 1:
        print("POSSIBLE")
        quit()
print("IMPOSSIBLE")

import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product


def input():
    return sys.stdin.readline()[:-1]


def ruiseki(lst):
    return [0] + list(accumulate(lst))


sys.setrecursionlimit(500000)
mod = pow(10, 9) + 7
al = [chr(ord("a") + i) for i in range(26)]
direction = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dic = {}
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]
for i in range(m):
    a, b = ab[i]
    if a == 1:
        dic[b] = 1
# print(dic)
for i in range(m):
    a, b = ab[i]
    if b == n and a in dic:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

+import bisect +import copy +import heapq +import math +import sys +from collections import * +from functools import lru_cache +from itertools import accumulate, combinations, permutations, product + + +def input(): +    return sys.stdin.readline()[:-1] + + +def ruiseki(lst): +    return [0] + list(accumulate(lst)) + + +sys.setrecursionlimit(500000) +mod = pow(10, 9) + 7 +al = [chr(ord("a") + i) for i in range(26)] +direction = [[1, 0], [0, 1], [-1, 0], [0, -1]] +dic = {} -ninoshima = [[0] * (n + 1) for i in range(2)] -    if ab[i][0] == 1: -        ninoshima[0][ab[i][1]] = 1 -    if ab[i][1] == n: -        ninoshima[1][ab[i][0]] = 1 -for i in range(n + 1): -    if ninoshima[0][i] == ninoshima[1][i] == 1: +    a, b = ab[i] +    if a == 1: +        dic[b] = 1 +# print(dic) +for i in range(m): +    a, b = ab[i] +    if b == n and a in dic: -        quit() -print("IMPOSSIBLE") +        break +else: +    print("IMPOSSIBLE")