let () =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let as_ = Array.to_list @@ Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in
  let minimum = List.fold_left min max_int as_ in
  let maximum = List.fold_left max min_int as_ in
  let minimums = List.length (List.filter (( = ) minimum) as_) in
  let maximums = List.length (List.filter (( = ) maximum) as_) in
  print_endline begin
    if maximum = minimum && (maximum = n - 1 || 2 * maximum <= n)
    || minimum + 1 = maximum && minimums < maximum && 2 * (maximum - minimums) <= maximums then "Yes"
    else "No" end