N = int(input())
A = [int(a) for a in input().split()]

for n in range(N):
  my_nm = A[n]
  if n == N-1:
    total_neighbor_nm = A[N-2] ^ A[0]
  else:
    total_neighbor_nm = A[n-1] ^ A[n+1]
  
  if my_nm != total_neighbor_nm:
    print("No")
    break
else:
  print("Yes")