import Data.List
main=do
 [n,m]<-words<$>getLine
 ab<-map words.lines<$>getContents
 let s=[y|[x,y]<-ab,x=="1"]
 let t=[x|[x,y]<-ab,y==n]
 putStrLn$if length(intersect s t)>0 then"POSSIBLE"else"IMPOSSIBLE"