import Control.Monad
import qualified Data.ByteString.Char8 as BS
import Data.Maybe

readInt = fst . fromJust . BS.readInt

readIntList = map readInt . BS.words

getIntList = readIntList <$> BS.getLine

getIntNList n = map readIntList <$> replicateM (fromIntegral n) BS.getLine

getNum :: [[Int]] -> Int -> [Int] -> [Int] -> ([Int], [Int])
getNum [] n as bs = (as, bs)
getNum (xy : xys) n as bs
  | head xy == 1 = getNum xys n ((last xy) : as) bs
  | last xy == 1 = getNum xys n ((head xy) : as) bs
  | head xy == n = getNum xys n as ((last xy) : bs)
  | last xy == n = getNum xys n as ((head xy) : bs)
  | otherwise = getNum xys n as bs

judge :: [Int] -> [Int] -> String
judge (x : xs) ys
  | x `elem` ys = "POSSIBLE"
  | otherwise = "IMPOSSIBLE"

main = do
  [n, m] <- getIntList
  abs <- getIntNList m
  let (xs, ys) = getNum abs n [] []
  putStrLn $ judge xs ys
