import Data.List

main::IO ()
main = do
    [n,m] <- map read . words <$> getLine ::IO [Int]
    queries <- sequence $ replicate m (map read . words <$> getLine)

    let ys = [a |a <- queries,a!!0 == 1]
        zs = [b |b <- queries,b!!1 == n]
        ans = elem 3 $ map (\e -> (length . nub)e) [c ++ d | c <- ys , d <- zs]
    
    putStrLn $ if ans then "POSSIBLE" else "IMPOSSIBLE"
