let () = Scanf.scanf "%d %d\n" @@ fun x n ->
  let ps = List.init n @@ fun _ -> Scanf.scanf "%d " Fun.id in
  Printf.printf "%d\n" @@
  List.fold_left (fun y y' ->
    if abs (y - x) <= abs (y' - x) then y else y') 0 @@
  List.filter (fun y -> List.for_all (( <> ) y) ps) @@
  List.init 102 Fun.id

