N=int(input())
shurui={}
a=list(map(int,input().split()))
if N%3==0:
  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]:
      print('Yes')
    else:
      print('No')
  elif len(shurui)==2:
    if atai[0]*2==atai[1]:
      if kagi[0]^kagi[0]==kagi[1]:
        print('Yes')
      else:
        print('No')
    elif atai[1]*2==atai[0]:
      if kagi[1]^kagi[1]==kagi[0]:
        print('Yes')
      else:
        print('No')
    else:
      print('No')
  elif len(shurui)==3:
    if atai[0]==atai[1]==atai[2]:
      if kagi[0]^kagi[1]==kagi[2]:
        print('Yes')
      else:
        print('No')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')