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

if N%3:
  if all([a==0 for a in A]):
    print('Yes')
  else:
    print('No')

else:
  for i in range(0,3):
    for j in range(0,N//3):
      if A[3*j - i]^A[3*j - i+1]^A[3*j -i + 2] == 0:
        continue
      else:
        print('No')
        exit()
  print('Yes')