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

import copy
hats = A[:]

import queue
q = queue.Queue()

for i, h1 in enumerate(hats):
    hats2 = hats[i+1:]
    for j, h2 in enumerate(hats2):
        hats3 = hats2[j+1:]
        for h3 in hats3:
            set_hats = set(hats)
            set_hats.discard(h1)
            set_hats.discard(h2)
            set_hats.discard(h3)
            q.put({'top': h1, 'three': [h1, h2, h3], 'set_hats': set_hats})
            q.put({'top': h1, 'three': [h1, h3, h2], 'set_hats': set_hats})
            
ans = 'No'
while not q.empty():
    data = q.get()
    #print(data)
    three = data['three']
    
    if three[0] ^ three[2] != three[1]:
        continue
       
    top = data['top']
    if top == None:
        ans = 'Yes'
        break
    
    set_hats = data['set_hats']
    if len(set_hats) == 0:
        three = three[1:] + [top]
        top = None
        q.put({'top': top, 'three': three, 'set_hats': set_hats})
    else:
        for s in set_hats:
            tmp = copy.copy(set_hats)
            tmp.discard(s)
            three = three[1:] + [s]
            q.put({'top': top, 'three': three, 'set_hats': tmp})
        
print(ans)