import Data.List
import Data.Function
import Data.Bool

main = do
    [n,m] <- map read . words <$> getLine
    es <- tuplify . map read . words <$> getContents
    let fs = sort . map snd $ filter ((==1) . fst) es
        ss = sort . map fst $ filter ((==n) . snd) es
    putStrLn $ bool "IMPOSSIBLE" "POSSIBLE" . any ((2<=) . length) . group $ fs ++ ss

tuplify [] = []
tuplify (x:y:xs) = (x,y):tuplify xs
