module IntSet = Set.Make (struct
  type t = int
  let compare = (-)
end)

let read_ns () = Scanf.scanf "%d %d " (fun x y -> (x, y))

let () =
  let (n, m) = read_ns () in
  let rec doit i to1 toN =
    if i = m then (to1, toN)
    else
      let (a, b) = read_ns () in
      doit (i + 1)
        (if a = 1 then IntSet.add b to1 else to1)
        (if b = n then IntSet.add a toN else toN) in
  let (to1, toN) = doit 0 IntSet.empty IntSet.empty in
  print_endline
    (if IntSet.is_empty (IntSet.inter to1 toN) then "IMPOSSIBLE"
     else "POSSIBLE")