from collections import Counter
n = int(input())
x = list(map(int,input().split()))
c = Counter(x)
k = list(c.keys())
k.sort()
v = list(c.values())
if len(c)==3:
    if v[0]==v[1]==v[2]:
        if k[0]^k[2]==k[1]:
            print('Yes')
            exit()
elif len(c)==1:
    if k[0]^k[0]==k[0]:
        print('Yes')
        exit()
elif len(c)==2:
    if k[0]^k[0]==k[1] and k[1]^k[1]==k[0]:
        if v[0]==v[1]:
            print('Yes')
            exit()

print('No')
