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):
        d[h1][h2] = h1^h2
        d[h2][h1] = h1^h2
    
    
def dfs(now1, now2, used):
    if len(used) == N:
        return True
    
    now3 = d[now1][now2]
    if d[now3] == {}:
        return False
    
    used = used[:] + [now2]
    for s in d[now3]:
        if d[now3][s] == now2:
            continue
        if dfs(now3, s, used):
            return True
        
    return False

ans = False
for s in d[hats[0]]:
    tmp = dfs(hats[0], s, [])
    if tmp == True:
        ans = True
        break
        
if ans:
    print('Yes')
else:
    print('No')
    
        