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

M = {}
for t in a:
  if t not in M:
    M[t] = 0
  M[t] += 1

if N%3!=0:
  if 0 in M and M[0]==N:
    ans = "Yes"
  else:
    ans = "No"
else:
  V = list(M)
  if len(V)==1:
    if 0 in M and M[0]==N:
      ans = "Yes"
    else:
      ans = "No"
  elif len(V)==2:
    a = V[0]
    b = V[1]
    if M[a]*2==M[b]:
      if a^a==b:
        ans = "Yes"
      else:
        ans = "No"
    elif M[b]*2==M[a]:
      if b^b==a:
        ans = "Yes"
      else:
        ans = "No"
    else:
      ans = "No"
  elif len(V)==3:
    a = V[0]
    b = V[1]
    c = V[2]
    if M[a]==M[b]==M[c] and a^b==c:
      ans = "Yes"
    else:
      ans = "No"
  else:
    ans = "No"
print ans
