let id x = x
let (n,m) = Scanf.scanf "%d %d\n" (fun a b -> (a,b))

let array = Array.init m (fun _ -> (Scanf.scanf "%d %d\n") (fun a b -> (a,b)))

(* let () = Array.sort array *)
  
let list = Array.to_list array
(* let list = List.sort compare list1 *)

  
let rec func list' flist slist =
  match list' with
  | [] -> (flist,slist)
  | (1,snd) :: rest -> func rest flist (snd :: slist)
  | (fst,s) :: rest when s = n -> func rest (fst :: flist) slist
  | a :: rest -> func rest flist slist

let (fl,sl) = func list [] []

let rec func1 fl=
  match fl with
  | [] -> false
  | hd :: rest -> List.exists ((=) hd) sl || func1 rest
     
let ans =  if func1 fl then "POSSIBLE" else "IMPOSSIBLE"

  
let () =
  Printf.printf "%s\n" ans