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 (st,en) = solve ls n
  let res = not (null (st `intersect` en))
  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 -> ([Int],[Int])
solve ls n = (ls1,ls2) where
  ls1 = snd <$>  filter (\(a,_) -> a == 1) ls
  ls2 = fst <$> filter (\(_,b) -> b == n) ls
