n = int(input())
a = list(map(int, input().split()))
b = []
def f(a):
  c = 0
  for i in range(n-1):
    if a[i-1] ^ a[i+1] == a[i]:
      c += 1
    else:
      c = -1
      break
  if a[0] ^ a[n-2] == a[n-1] and c > -1:
    return True
  else:
    return False
for i in range(n):
  b.append(f(a))
  c = a.pop(a[0])
  a.append(c)
if any(b):
  print("Yes")
else:
  print("No")