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 list = Array.to_list array
  
  
let rec func list' =
  match list' with
  | [] -> false
  | (1,snd) :: rest ->
     List.exists ((=) (snd,n)) list || func rest
  | a :: rest -> func rest
  
let ans =  if func list then "POSSIBLE" else "IMPOSSIBLE"

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