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

hats = A[:]

from collections import defaultdict
d = defaultdict(lambda: {})

for i, h1 in enumerate(hats):
    hats2 = hats[i+1:]
    for j, h2 in enumerate(hats2):
        h3 = h1^h2
        d[h1][h3] = h2
        d[h3][h1] = h2

#print(d)
        
def dfs(top, now1, now2, count):
    if now2 == top:
        #print(count)
        if count == N:
            return True
        else:
            return False

    now1, now2 = now2, now2 ^ d[now1][now2]

    return dfs(top, now1, now2, count+1)
    
ans = False
h1 = hats[0]
for h2 in d[h1]:
    if dfs(h1, h1, h2, 2):
        ans = True
        
if ans:
    print('Yes')
else:
    print('No')