let n, m = Scanf.scanf " %d %d" @@ fun a b -> a, b
let ab_s = Array.(to_list @@ init m @@ fun _ -> Scanf.scanf " %d %d" @@ fun a b -> a - 1, b - 1)
let cs = Array.make n 0
let _ = List.(iter (fun (a, b) -> if a = 0 then cs.(b) <- 1) ab_s; print_endline @@ if exists (fun (a, b) -> b = n - 1 && cs.(a) = 1) ab_s then "POSSIBLE" else "IMPOSSIBLE")