n=int(input())
a=list(map(int,input().split()))
ans=a[0]
zero=0
sonota=0
for i in range(0,n):
  ans=ans^a[i]
k=-1000
for i in range(n):
  if a[i]==0:
    zero+=1
  elif k==a[i]:
    sonota+=1
  else:
    k=a[i]
    sonota=1
flag=False
if sonota==int(n/3) and zero==int(2*n/3):
  flag=True
if ans==a[0] or sum(a)==0 or flag:
  print("Yes")
else:
  print("No")
