import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed.Mutable as VUM
import Control.Monad
import Data.Tuple
import Data.Char
import Data.IORef

inter it a b
    | a == 1 = VUM.write it b True
    | b == 1 = VUM.write it a True
    | otherwise = return ()

dest it ds a b n
    | a == n = VUM.write ds b True
    | b == n = VUM.write ds a True
    | otherwise = return ()

main = do
    [n, m] <- Prelude.map read . Prelude.words <$> Prelude.getLine :: IO [Int]
    it <- VUM.replicate (n+1) False
    ds <- VUM.replicate (n+1) False
    res <- newIORef False
    forM_ [1..m] $ \_ -> do
        bs <- B.getLine
        let Just (a, bs') = B.readInt bs
            Just (b, _) = B.readInt $ B.dropWhile isSpace bs'
        inter it a b
        dest it ds a b n
    forM_ [1..n] $ \i -> do
        r <- VUM.read it i
        when r $ do
            r' <- VUM.read ds i 
            when r' $ modifyIORef' res (||True)
    
    readIORef res >>= \r -> putStrLn $ if r then "POSSIBLE" else "IMPOSSIBLE"