from collections import Counter

n=int(input())
a=list(map(int, input().split()))

flag="No"

count_by_kw = Counter()
for i in range(n):
    count_by_kw[a[i]]+=1

if count_by_kw.get(0) == n:
    flag="Yes"

if count_by_kw.get(0) == n/3 and len(count_by_kw.keys())==2:
    flag="Yes"

cl=list(count_by_kw.values())
ck=list(count_by_kw.values())

if len(cl)==3:
    if cl[0] == cl[1] and cl[1] == cl[2]:
        if ck[0]^ck[1]^ck[2]^ == 0
            flag="Yes"
        
print(flag)



