n = int(input())
a = list(map(int, input().split()))
if a.count(a[0]) != n//3 or n%3 != 0:
  print("No")
  exit()
a1 = a[0]
a = [x for x in a if x != a[0]]
if a.count(a[0]) != n//3:
  print("No")
  exit()
a2 = a[0]
a = [x for x in a if x != a[0]]
a3 = a[0]
if a1 ^ a3 == a2:
  print("Yes")
else:
  print("No")