import Data.List
import Control.Monad

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

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

readData :: Int -> IO [(Int,Int)]
readData m = replicateM m rdtpl

solve :: [(Int,Int)] -> Int -> Bool
solve ls n = n `elem` ls2 where
  ls1 = snd <$> filter (\(a,_) -> a == 1) ls
  f b  = filter (\(c,_) -> b == c)
  ls2 = nub . foldl1 union $ fmap ((\fu -> snd <$> fu ls) . f) ls1
