import Data.List

main :: IO ()
main = do
  con <- lines <$> getContents
  let [n,_] = fmap read . words $ head con :: [Int]
  let ls = fmap tupled $ fmap read . words <$> tail con :: [(Int,Int)]
  putStrLn $ if solve ls n then "POSSIBLE" else "IMPOSSIBLE"

tupled :: [Int] -> (Int,Int)
tupled [a,b] = (a,b)
tupled _ = undefined


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
