import qualified Data.ByteString.Char8 as BS
import Data.Maybe (fromJust)

solve :: Int -> [(Int,Int)] -> Bool
solve n m =
    let p1 = [ fst i | i <- m, snd i == n]
        p2 = [ i | j <- p1, i <- m, snd i == j && fst i == 1]
     in not (null p2)

main :: IO ()
main = do
    [n,_] <- map read . words <$> getLine :: IO [Int]
    ab <- map ((\[a,b] -> (a,b)) . map (fst . fromJust . BS.readInt) . BS.words)
        . BS.lines <$> BS.getContents :: IO [(Int,Int)]
    putStrLn $ if solve n ab then "POSSIBLE" else "IMPOSSIBLE"
