import Control.Monad
import qualified Data.List as L

 
main = do
  [n, m] <- map read . words <$> getLine
  es <- map (map read . words) <$> replicateM m getLine
  putStr $ solve n es
 
solve n es
  | null $ L.intersect as bs = "IMPOSSIBLE"
  | otherwise = "POSSIBLE"
    where
    as = [ b | [a, b] <- es, a == 1]
    bs = [ a | [a, b] <- es, b == n]