module M = Map.Make (struct type t = int let compare = compare end)

let () =
    let split s =
        let rec loop i cur flag acc =
            if i = String.length s then ( if flag then cur :: acc else acc) else (
                match flag, s.[i] with
                | true,  ' ' -> loop (i + 1) "" false (cur :: acc)
                | false, ' ' -> loop (i + 1) "" false acc
                | true,  v   -> loop (i + 1) (Printf.sprintf "%s%c" cur v) true acc
                | false, v   -> loop (i + 1) (Printf.sprintf "%s%c" cur v) true acc
            )
        in
        List.map int_of_string (List.rev (loop 0 "" false []))
    in
    let check a =
        let rep = Array.length a / 3 in
        let hist = Array.fold_left (fun map v -> M.add v (1 + try M.find v map with _ -> 0) map) M.empty a in
        let cont = Array.of_list (M.fold (fun k v acc -> (k, v) :: acc) hist []) in
        match Array.length cont with
        | 1 -> fst cont.(0) = 0 
        | 2 -> let (k1, v1) = cont.(0) in
               let (k2, v2) = cont.(1) in
               if v1 = rep * 2 && v2 = rep then (
                   k2 = 0
               ) else if v2 = rep * 2 && v1 = rep then (
                   k1 = 0
               ) else false
        | 3 -> let (k1, v1) = cont.(0) in
               let (k2, v2) = cont.(1) in
               let (k3, v3) = cont.(2) in
               v1 = rep && v2 = rep && v3 = rep && k1 lxor k2 lxor k3 = 0
        | _ -> false

    in
    let main () =
        let n = int_of_string (read_line ()) in
        let a = Array.of_list (split (read_line ())) in
        let flag = if n mod 3 = 0 then (
            check a
        ) else Array.fold_left (+) 0 a = 0
        in
        print_endline (if flag then "Yes" else "No")
    in
    main ()