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

if len(seta) == 3 and a.count(seta[0]) == a.count(seta[1]) and a.count(seta[1]) == a.count(seta[2]) and a.count(seta[2]) == a.count(seta[0]):
  if seta[0]^seta[1] == seta[2] and seta[1]^seta[2] == seta[0] and seta[0]^seta[2] == seta[1]:
    print("Yes")
elif len(seta) == 2:
  sseta = sorted(seta)
  if sseta[0] == 0 and a.count(sseta[1]) == a.count(sseta[0])*2:
    print("Yes")
  else:
    print("No")
elif len(seta) == 1 and seta[0] == 0:
  print("Yes")
else:
  print("No")