n=int(input())
a=list(map(int,input().split()))
x='No'
p=len(set(a))
if p==1:
  if a[0]==0:
    x='Yes'
elif p==2:
  if n%3==0:
    if a.count(0)==n//3:
      x='Yes'
elif p==3:
  if n%3==0:
    b=set(a)
    t=0
    for i in b:
      t=t^i
    if t==0:
      x='Yes'
print(x)