import Control.Applicative
import Control.Monad
import Data.List
import Data.Char
strToInt s = (read :: String -> Int) s
strToInteger s = (read :: String -> Integer) s
strToDouble s = (read :: String -> Double) s

main :: IO ()
main = do
    -- スペース区切り整数の入力
    [n, m] <- map strToInt . words <$> getLine
    ab <- replicateM m $ do
        [a, b] <- map strToInt . words <$> getLine
        return (a, b)
    -- 出力
    putStrLn $ if solve ab n 1 then "POSSIBLE" else "IMPOSSIBLE"

solve :: [(Int, Int)] -> Int -> Int -> Bool
solve [] g s = if s == g then True else False
solve ab g s = if (s == g) then True else (if null ships then False else or $ map (solve ab g . snd) ships)
    where
        ships = filter ((== s) . fst) ab
