import Control.Monad
import qualified Data.Set as S
 
main = do
  [n, m] <- map read . words <$> getLine
  es <- map (map read . words) <$> replicateM m getLine
  putStr $ solve n es
 
solve n es
  | S.null $ S.intersection as bs = "IMPOSSIBLE"
  | otherwise = "POSSIBLE"
    where
    as = S.fromList [ b | [a, b] <- es, a == 1]
    bs = S.fromList [ a | [a, b] <- es, b == n]
  