from itertools import combinations

N = int(input())
*A, = map(int, input().split())
setA = set(A)
if len(setA) == 3:
    for a, b, c in combinations(setA, 3):
        if a ^ c == b and b ^ a == c: print('Yes'); break;
    else: print('No')
elif len(setA) <= 2:
    maxA = max(setA)
    if A.count(0) == A.count(maxA): print('Yes')
    else: print('No')
else: print('No')