import           Control.Exception           (assert)
import           Control.Monad
import qualified Control.Monad.ST            as ST
import qualified Data.Array.IO               as IO
import qualified Data.Array.ST               as ST
import qualified Data.Array.Unboxed          as A
import           Data.Bits
import qualified Data.ByteString.Char8       as BS
import           Data.Char
import           Data.Foldable
import           Data.List
import           Data.Maybe
import qualified Data.Sequence               as Seq
import qualified Data.Set                    as Set
import qualified Data.Vector.Unboxed         as V
import qualified Data.Vector.Unboxed.Mutable as VM
import           Debug.Trace

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
getIntVec n = V.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

readInteger = fst . fromJust . BS.readInteger
readIntegerList = map readInteger . BS.words
getInteger = readInteger <$> BS.getLine
getIntegerList = readIntegerList <$> BS.getLine

main = do
  [n, m] <- getIntList

  d <- VM.new (n-1)
  VM.set d (0::Int)

  replicateM_ m $ do
    [a, b] <- getIntList
    when (a == 1) $ do
      t <- VM.read d (b-1)
      let t' = t .|. 1
      VM.write d (b-1) t'
      when (t' == 3) $ VM.write d 0 1
    when (b == n) $ do
      t <- VM.read d (a-1)
      let t' = t .|. 2
      VM.write d (a-1) t'
      when (t' == 3) $ VM.write d 0 1

  res <- VM.read d 0
  let ans = if res == 1 then "POSSIBLE" else "IMPOSSIBLE"
  putStrLn ans