open Batteries
let n, m = Scanf.scanf "%d %d" (fun x y -> x, y)
let edges = List.init m (fun _ -> Scanf.scanf " %d %d" (fun x y -> x, y))
let find_neighbors x =
  edges |> List.filter_map (fun (a, b) ->
    if a = x then Some b else if b = x then Some a else None)
let () =
  let count = Array.make (n+1) 0 in
  find_neighbors 1 |> List.iter (fun v -> count.(v) <- count.(v) + 1);
  find_neighbors n |> List.iter (fun v -> count.(v) <- count.(v) + 1);
  begin try
    count |> Array.findi ((<=) 2) |> ignore; "POSSIBLE"
  with Not_found -> "IMPOSSIBLE"
  end |> print_endline
