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()
print('No')
