import collections
N = int(input())

num = list(map(int,input().split()))
c = collections.Counter(num)
if len(c) == 3:
  if c.most_common()[0][1] == c.most_common()[1][1]:
    if (c.most_common()[0][0])^(c.most_common()[1][0]) == c.most_common()[2][0]:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
elif len(c) == 2:
  if c.most_common()[0][1] == 2*c.most_common()[1][1]:
    if c.most_common()[1][0] == 0:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')
