import qualified Data.ByteString.Char8 as B
import qualified Data.Array.IArray as A
import Data.Maybe
import Data.Bool

main = do
  [n,_] <- map read . words <$> getLine
  es <- readUndirectedEdge <$> B.getContents
  let g = buildG n es
  putStrLn $ bool "IMPOSSIBLE" "POSSIBLE" (voyage n g)

voyage n g = any (elem n . from g) (from g 1)

type Vertex = Int
type Edge = (Vertex, Vertex)
type Graph = A.Array Vertex [Vertex]

buildG :: Int -> [Edge] -> Graph
buildG n = A.accumArray (flip (:)) [] (1, n)

from :: Graph -> Vertex -> [Vertex]
from g = (g A.!)

readUndirectedEdge :: B.ByteString -> [Edge]
readUndirectedEdge = concatMap (constructTwoWay . map readInt . B.words) . B.lines

constructTwoWay :: [Int] -> [Edge]
constructTwoWay [s,t] = [(s, t), (t, s)]
constructTwoWay _ = undefined

readInt :: B.ByteString -> Int
readInt = fst . fromJust . B.readInt
