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


if __name__ == '__main__':
  main()
