# https://atcoder.jp/contests/agc035/tasks/agc035_a
import numpy as np


def calc(N: int, values: np.ndarray) -> bool:
    if N % 3 != 0:
        return False

    uniques = np.unique(values)
    if len(uniques) != 3:
        return False

    counts = [np.sum(values == v) for v in uniques]  # 各固有値の格納数
    if len(np.unique(counts)) != 1:
        return False

    sorted_uniques = np.sort(uniques)
    return sorted_uniques[0] == np.bitwise_xor(sorted_uniques[1], sorted_uniques[2])


def load_input_as_int_array():
    return np.array([int(v) for v in input().split(" ")])


N = int(input())
values = load_input_as_int_array()
result = calc(N, values)

if result:
    print("Yes")
else:
    print("No")
