n=int(input())
arr=list(map(int,input().split()))
dic={}
for val in arr:
  if val not in dic:
    dic[val]=1
  else:
    dic[val]+=1
l=len(dic)
if n%3!=0:
  print('No')
else:
  if l==1:
    arr2=list(dic.keys())
    if arr2[0]==0:
      print('Yes')
    else:
      print('No')
  elif l==2:
    arr2=list(dic.values())
    if (arr2[0]==(2*n)//3 and arr2[1]==n//3) or (arr2[0]==n//3 and arr2[1]==(2*n)//3):
      print('Yes')
    else:
      print('No')
  elif l==3:
    arr2=list(dic.keys())
    arr3=list(dic.values())
    if (arr2[0]^arr2[1]^arr2[2])==0:
      if arr3[0]==n//3 and arr3[1]==n//3 and arr3[2]==n//3:
        print('Yes')
      else:
        print('No')
    else:
      print('No')
  else:
    print('No')