import Data.List
main=do
 [n,m]<-map read.words<$>getLine
 ab<-map(map read.words).lines<$>getContents
 let s=sort[y|[x,y]<-ab,x==1]
 let t=sort[x|[x,y]<-ab,y==n]
 putStrLn$if f s t then"POSSIBLE"else"IMPOSSIBLE"
f s[]=False
f []t=False
f a@(s:ss) b@(t:ts)
 |s<t=f ss b
 |s==t=True
 |s>t=f a ts