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 any (search graph n) [1..n]
    then "POSSIBLE"
    else "IMPOSSIBLE"

search graph n i = do
  let maybeNeighbors = Map.lookup i graph
  case maybeNeighbors of
    Nothing -> False
    Just neighbors -> 1 `elem` neighbors && n `elem` neighbors

buildGraph graph 0 goal = return graph
buildGraph graph n 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'' (n - 1) goal
    else
      buildGraph graph (n - 1) goal
