from collections import Counter
from itertools import permutations
n = int(input())
a = list(map(int, input().split()))
cnt = Counter(a)
if n % 3 != 0 or len(cnt) != 3:
    print('No')
else:
    key = []
    num = []
    for i, j in cnt.items():
        key.append(i)
        num.append(j)
    if len(set(num)) != 1:
        print('No')
    else:
        flag = 0
        for a, b, c in permutations(key):
            if a^b == c:
                flag = 1
                break
        if flag:print('Yes')
        else:print('No')