module Main where

import Control.Applicative
import Control.Monad
import Data.List
import qualified Data.Graph as G

bfs :: [G.Tree Int] -> [[Int]]
bfs [] = []
bfs ts = fmap root ts : bfs (concatMap sub ts)
  where
    root (G.Node r _)  = r
    sub  (G.Node _ sf) = sf

main :: IO ()
main = do
    [n, m] <- fmap read . words <$> getLine :: IO [Int]
    as <- replicateM m $ do
        [a, b] <- fmap read. words <$> getLine :: IO [Int]
        return (a, b)

    let g = G.buildG (1, n) as
    let tree = G.dfs g [1]
    let bss = take 3 $ bfs tree

    if length bss < 3
        then putStrLn "IMPOSSIBLE"
        else do
            if any (== n) (bss !! 2)
                then putStrLn "POSSIBLE"
                else putStrLn "IMPOSSIBLE"