import Data.Maybe
import qualified Data.ByteString.Char8 as B
import qualified Data.IntSet as IS
main=putStrLn.solve.map(map(fst.fromJust.B.readInt).B.words).B.lines.B.getContents
solve([n,m]:ab)=if any(flip IS.member e)s then"POSSIBLE"else"IMPOSSIBLE"where
  (s,e)=foldr f n([],IS.empty)ab
f n[a,b](s,e)
  |a==1=(b:s,e)
  |b==n=(s,IS.insert a e)
  |otherwise=(s,e)