from itertools import combinations

N = int(input())
a = list(map(int, input().split()))

c = [0] * (10 ** 9 + 1)
for e in a:
    c[e] += 1

for x, y in combinations(set(a), 2):
    t = [0] * (10 ** 9 + 1)
    i, j = x, y
    t[i] += 1
    t[j] += 1
    for _ in range(N - 2):
        k = i ^ j
        t[k] += 1
        if t[k] > c[k]:
            j = -1
            break
        i, j = j, k
    if j ^ x == y:
        print('Yes')
        exit()
print('No')
