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

xor = []

for i in range(N):
  if i != (N-1) and i != (N-2):
    xor.append(an[i]^an[i+2])
  else:
    xor.append(an[i]^an[i-(N-2)])
    
for i in range(N):
  if an[i] in xor:
    xor.remove(an[i])

if xor:
  print('No')
else:
  print('Yes')

