import collections
n = int(input())
a = list(map(int, input().split()))

c = collections.Counter(a)
v = list(c.values())
k = list(c.keys())

if n % 3 == 0 and v[0] == v[1] == v[2] and k[0] ^ k[1] == k[2]:
  print("Yes")
else:
  print("No")
