import Control.Monad
import Data.List
main=do
 [n,m]<-map read.words<$>getLine
 ab<-replicateM m (words<$>getLine)
 putStrLn(h(f n ab)(g 1 ab))
  where f n ab = [x!!0|x<-ab,(x!!1)==(show n)]
        g n ab = [x!!1|x<-ab,(x!!0)==(show n)]
        h a b = if [1|x<-a,y<-b,x==y]==[] then"IMPOSSIBLE"else"POSSIBLE"