open Str

let read_list f =
  split (regexp " +") (read_line ()) |> List.map f

let rec span f = function
    [] -> ([],[])
  | h :: t when f h -> let (xs, ys) = span f t in (h::xs, ys)
  | l -> ([],l)

let rec group f = function
  | [] -> []
  | h :: t -> let (xs, ys) = span (f h) t in (h :: xs) :: group f ys
                                                                
let () =
  let n = read_int () in
  let xs = read_list int_of_string in
  let gxs = List.sort compare xs |> group (fun x y -> x = y) |> List.map (fun xs -> (List.hd xs, List.length xs))in
  (if List.length gxs > 2 then "No"
   else
     if List.length gxs = 1 then
       if List.hd xs = n - 1 then "Yes"
       else
         if n / 2 >= (List.hd xs) then "Yes" else "No"
     else
      let u,v = List.hd gxs in
      if (n-v) / 2 >= 1 && u+1-v >= 1 && (n-v) / 2 >= (u+1-v) then "Yes" else "No") |> print_endline
