import Control.Applicative( (<$>))
import Control.Monad( replicateM)
import Data.IntSet( empty, insert, intersection, null)
import qualified Data.IntSet as IS

main = do
    [n_, m_] <- map read . words <$> getLine
    let
	pass = do
	    [a,b] <- map read . words <$> getLine
	    return (a,b)

    passes_ <- replicateM m_ pass
    let
	proc oneside nside []		    = (oneside,nside)
	proc oneside nside ((a,b):passes)
	  | b==n_	    = let
				nside' = insert a nside
			    in
				proc oneside nside' passes

	  | 1==a	    = let
				oneside' = insert b oneside
			    in
				proc oneside' nside passes

	  | otherwise	    = proc oneside nside passes
    
	(oneSide, nSide) = proc empty empty passes_

    putStr $ if IS.null $ oneSide `intersection` nSide
		then "IMPOSSIBLE"
		else "POSSIBLE"
	    