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

def XOR(x, y):
  u, i = 0, 0
  while x != 0 or y != 0:
    u += ((x + y) % 2) * (2 ** i)
    x //= 2
    y //= 2
    i += 1
  return u

Q = []
for i in range(1, len(A)):
  M = XOR(A[0], A[i])
  L = [A[0], A[i]]
  for j in range(len(A)-2):
    L.append(XOR(L[j], L[j+1]))
  Q.append(L)

B = A[:]
k = 0
for s in range(len(Q)):
  for l in range(len(Q[s])):
    for g in range(len(A)):
      if A[g] == Q[s][l]:
        B[g] = Q[s][l]
  if B == Q[s]:
    k += 1
    
if k != 0:
  print('Yes')
else:
  print('No')