import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as VU
import qualified Data.Map as MP
import Data.Tuple
import Data.Char

toTuple :: B.ByteString -> (Int, Int)
toTuple bs =
    let
        Just (a, bs') = B.readInt bs
        Just (b, _) = B.readInt $ B.dropWhile isSpace bs'
    in
        (a, b)

make :: VU.Vector (Int, Int) -> MP.Map Int (VU.Vector Int)
make edges = VU.foldl' step MP.empty (edges VU.++ VU.map swap edges)
    where
        step :: MP.Map Int (VU.Vector Int) -> (Int, Int) -> MP.Map Int (VU.Vector Int)
        step graph (from, to) =
            case MP.lookup from graph of
                Just _ -> MP.adjust (VU.cons to) from graph
                Nothing -> MP.insert from (VU.singleton to) graph

solve :: MP.Map Int (VU.Vector Int) -> Int -> Int -> Int -> Bool
solve graph curr dst cnt
    | cnt == 2 && curr /= dst = False
    | cnt == 2 && curr == dst = True
    | otherwise = 
        case MP.lookup curr graph of
            Just ns -> VU.or $ VU.map (\n -> solve graph n dst (cnt+1)) ns
            Nothing -> False

main = do
    (n, m) <- toTuple <$> B.getLine
    abs <- VU.replicateM m (toTuple <$> B.getLine)
    let graph = make abs
    putStrLn $ if solve graph 1 n 0
        then "POSSIBLE"
        else "IMPOSSIBLE"