import qualified Data.Map as Map

main :: IO ()
main = do
  [n, m] <- (map read . words) <$> getLine :: IO [Int]
  graph <- buildGraph (Map.fromList [] ) m n
  putStrLn $ if maximum (map length $ Map.elems graph) == 2
    then "POSSIBLE"
    else "IMPOSSIBLE"

buildGraph graph 0 goal = return graph
buildGraph graph m goal = do
  [a, b] <- (map read . words) <$> getLine :: IO [Int]
  if a == 1 || b == 1 || a == goal || b == goal
    then do
      let graph' = Map.insertWith (++) a [b] graph
      let graph'' = Map.insertWith (++) b [a] graph'
      buildGraph graph'' (m - 1) goal
    else
      buildGraph graph (m - 1) goal
