import Data.List
import qualified Data.Set as Set
import qualified Data.ByteString.Char8 as BC
import Data.Maybe

type Set = Set.Set Int

toTuple [a, b] = (a, b)

readIntsLines :: IO [(Int, Int)]
readIntsLines = map (toTuple . map (fst . fromJust . BC.readInt) . BC.words) . BC.lines <$> BC.getContents

build :: [(Int, Int)] -> Set -> Set
build [] s = s
build ((a, b):xs) s
  | a == 1 = build xs $ Set.insert b s
  | otherwise = build xs s

solve :: [(Int, Int)] -> Int -> Set -> Bool
solve [] _ _ = False
solve ((a, b):xs) n s
  | b == n = (a `elem` s) || solve xs n s
  | otherwise = solve xs n s

main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  ls <- readIntsLines
  putStrLn $ if solve ls n (build ls Set.empty) then "POSSIBLE" else "IMPOSSIBLE"