import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Control.Monad.Primitive (PrimState)
import Data.Maybe (fromJust)

main = do
  [n,m] <- map read . words <$> getLine :: IO [Int]
  mv <- VUM.replicate (2*m) (0,0) :: IO (VUM.MVector (PrimState IO) (Int,Int))
  forM_ [1..m] $ \i -> do
    [a,b] <- map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine 
    VUM.write mv (i-1) (a,b)
    VUM.write mv (m+i-1) (b,a)
  v <- VU.unsafeFreeze mv
  let ones = VU.map snd $ VU.filter ((==1) . fst) v
  print ones
  putStrLn $ if solve ones n v then "POSSIBLE" else "IMPOSSIBLE"
  

solve :: VU.Vector Int -> Int -> VU.Vector (Int,Int) -> Bool
solve ones dest lines = VU.foldl (\b (i,k) -> b || (VU.elem i ones && k==dest)) False lines