N = int(input())
a = list(map(int, input().split()))

R = {}
for i in a:
  if i in R:
    R[i] += 1
  else:
    R[i] = 1

ans = ["Yes", "No"]
if 0 in R:
  if len(R) == 1:
    print(ans[0])
  elif len(R) == 2:
    for i in R.keys():
      if i != 0:
        x = R[i]
      else:
        z = R[i]
    if x == z * 2:
      print("hoge")
    else:
      print(ans[1])
  else:
    print(ans[1])
else:
  if len(R) != 3:
    print(ans[1])
  else:
    t = -1
    for i in R.values():
      if t == -1:
        t = i
      else:
        if i != t:
          print(ans[1])
          break
    else:
      a = b = c = -1
      for i in R.keys():
        if a == -1:
          a = i
        elif b == -1:
          b = i
        else:
          c = i
      if a ^ b == c:
        print(ans[0])
      else:
        print(ans[1])
