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