n = int(input())
a = list(map(int, input().split()))
c = 0
for i in range(n-1):
  if a[i-1] ^ a[i+1] == a[i]:
    c += 1
  else:
    break
if a[0] ^ a[n-2] == a[n-1] and c == n-1:
  print("Yes")
else:
  print("No")