N = int(input())
A = list(map(int, input().split()))
assert len(A) == N

def yes():
    S = set(A)
    if A.count(0) == N:
        return True
    if N % 3 != 0 or len(S) != 3 or any(A.count(x) != N // 3 for x in S):
        return False
    a, b, c = tuple(S)
    return a ^ b == c

print('Yes' if yes() else 'No')
