import qualified Data.ByteString.Char8 as BS
import Data.Maybe (fromJust)
import qualified Data.IntMap as M

solve :: Int -> M.IntMap Int -> Maybe Int
solve n m = do
    p1 <- M.lookup n m
    p2 <- M.lookup p1 m
    if p2 == 1 then Just p2 else Nothing

main :: IO ()
main = do
    [n,_] <- map read . words <$> getLine :: IO [Int]
    ab <- map ((\[a,b] -> (b,a)) . map (fst . fromJust . BS.readInt) . BS.words)
        . BS.lines <$> BS.getContents :: IO [(Int,Int)]
    let m = M.fromList ab
    case solve n m of
        Just _ -> putStrLn "POSSIBLE"
        _      -> putStrLn "IMPOSSIBLE"