N=int(input())
shurui={}
a=list(map(int,input().split()))
result=False
for i in range(N):
  if a[i] in shurui:
    shurui[a[i]]+=1
  else:
    shurui[a[i]]=1
kagi=list(shurui.keys())
atai=list(shurui.values())

if len(shurui)==1:
  if kagi[0]^kagi[0]==kagi[0]:
    result=True
elif len(shurui)==2:
  if atai[0]*2==atai[1]:
    if kagi[0]^kagi[1]==kagi[0]:
      result=True
  elif atai[1]*2==atai[0]:
    if kagi[0]^kagi[1]==kagi[1]:
      result=True
elif len(shurui)==3:
  if atai[0]==atai[1]==atai[2]:
    if kagi[0]^kagi[1]==kagi[2]:
      result=True
if result==True:
  print('Yes')
else:
  print('No')