def main():
  n = int(input())
  alist = list(sorted(map(int, input().split())))
  aset = set(alist)
  tmpal = list(aset)
  if len(aset) > 3:
    print('No')
  elif len(aset) == 1:
    if tmpal[0] == 0:
      print('Yes')
    else:
      print('No')
  elif n % 3 != 0:
    print('No')
  else:
    if len(aset) == 2:
      if alist.count(0) == n // 3:
        print('Yes')
      else:
        print('No')
    else:
      if tmpal[0] ^ tmpal[2] == tmpal[1]:
        print('Yes')
      else:
        print('No')


if __name__ == '__main__':
  main()
