module Main where

import Control.Applicative
import Control.Monad
-- import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Array.IArray
import Data.Array.MArray
import Data.Array.ST
import Data.Array.Unboxed

readi b | Just (n, _) <- B.readInt b = n

main :: IO ()
main = do
    [n, m] <- fmap read . words <$> getLine :: IO [Int]
    as <- fmap ((\[a, b] -> (readi a, readi b)) . B.words) . B.lines <$> B.getContents

    let ary = runSTUArray $ do
            a <- newArray ((1, 1), (n, n)) False
            forM_ as $ \(i, j) -> do
                writeArray a (i, j) True
            return a

    let f i = and [ary ! (1, i), ary ! (i, n)]

    if any f [2 .. n - 1]
        then putStrLn "POSSIBLE"
        else putStrLn "IMPOSSIBLE"