module IntMap = Map.Make (struct
  type t = int
  let compare x y = compare y x
end)

let add x s =
  IntMap.add x
    (1 +
      try IntMap.find x s
      with Not_found -> 0) s

let remove x s =
  match IntMap.find x s with
  | exception Not_found -> s
  | 1 -> IntMap.remove x s
  | n -> IntMap.add x (n - 1) s

let () = Scanf.scanf "%d\n" @@ fun n ->
  let ss =
    Array.init (1 lsl n) @@ fun _ ->
      Scanf.scanf "%d " @@ fun s -> s in
  let rec solve (q, ss) = function
    | 0 -> ()
    | n ->
        solve
          (IntMap.fold (fun s n ->
            Array.fold_right (fun () (q, ss) ->
              let (_, _, r) = IntMap.split s q in
              let (s', _) = IntMap.min_binding r in
              (remove s' q, add s' ss)) @@
            Array.make n ()) ss (q, ss)) (n - 1) in
  let q = Array.fold_right add ss IntMap.empty in
  let (s, _) = IntMap.min_binding q in
  print_endline @@
  try solve (remove s q, IntMap.singleton s 1) n; "Yes"
  with Not_found -> "No"

