n = int(input())
an = [int(i) for i in input().split()]

for i in range(n-1):
  if an[i] != (an[i-1] ^ an[i+1]):
    print('No')
    exit()
if an[n-1] != (an[n-2] ^ an[0]):
  print('No')
else:
  print('Yes')