from collections import*
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in a[1:]:
  ans^=i
flag=ans==0
a=dict(Counter(a))
ak=list(a.keys())
if n%3:flag=0
elif len(a)==1 and ak[0]!=0:flag=0
elif len(a)==2 and a.get(0)!=n//3:flag=0
elif len(a)==3 and not(a[ak[0]]==a[ak[1]]==a[ak[2]]==n//3):flag==0
print(['No','Yes'][flag])