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

hats = A[:]
import copy
from collections import defaultdict
d = defaultdict(lambda: 0)

for h in hats:
    d[h] += 1

def f():
    if len(d) == 3:
        xor = 0
        for key in d:
            xor ^= key
        if xor == 0:
            lsit_d = list(d.keys())
            if d[lsit_d [0]] == d[lsit_d [1]] and d[lsit_d [0]] == d[lsit_d [2]]:
                return 'Yes'
            else:
                return 'No'
        else:
            return 'No'

    if len(d) == 1:
        lsit_d = list(d.keys())
        if lsit_d [0] == 0:
            return 'Yes'
    
    return 'No'
    
print(f())
 
