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