module Main where

import Control.Applicative
import Control.Monad
import Data.List
import Data.Maybe
import qualified Data.Map as M
import qualified Data.ByteString.Char8 as B

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), True)) . B.words) . B.lines <$> B.getContents
    let hs = M.fromList as
    let f i = all isJust [M.lookup (1, i) hs, M.lookup (i, n) hs]
    if any f [2 .. n - 1]
        then putStrLn "POSSIBLE"
        else putStrLn "IMPOSSIBLE"