import Control.Monad
import Control.Applicative
import Data.List
import Data.Array
strToInt s = (read :: String -> Int) s

main = do
   [n,m] <- (map strToInt . words) <$> getLine
   ab <- replicateM m (map strToInt . words <$> getLine)
   let cn = [(decide a ab n) | a <- (startset ab)]
   
   if (elem True cn) == True
   then putStrLn "POSSIBLE"
   else putStrLn "IMPOSSIBLE"

decide :: [Int] -> [[Int]] -> Int -> Bool
decide x xn n = elem n yn
                where yn = [(last xa) |xa <- xn , (last x) == (head xa) ]

startset :: [[Int]] -> [[Int]]
startset xn = [xa | xa <- xn , (head xa) == 1]