import Data.List
import Control.Monad

main :: IO ()
main = do
  [n,m] <- fmap read . words <$> getLine :: IO [Int]
  ls <- readData m :: IO [(Int,Int)]
  putStrLn $ if solve ls n then "POSSIBLE" else "IMPOSSIBLE"

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

solve :: [(Int,Int)] -> Int -> Bool
solve ls n = not (null (ls1 `intersect` ls2)) where
  ls1 = snd <$> filter (\(a,_) -> a == 1) ls
  ls2 = fst <$> filter (\(_,b) -> b == n) ls
