N=int(input())
a=list(map(int,input().split()))
dp=[]
bp=[]
ans=a[0]^a[2]
for i in range(1,N+1,2):
  if i==1:
    dp.append(ans)
    continue
  ans=(ans^a[i-3])^a[(i+1)%N]
  dp.append(ans)
ans=a[1]^a[-1]
for i in range(0,N+1,2):
  if i==0:
    bp.append(ans)
    continue
  ans=(ans^a[i-3])^a[(i+1)%N]
  bp.append(ans)
for i in range(N):
  if i%2==0:
    if a[i]!=bp[i//2]:
      print('No')
      exit()
  else:
    if a[i]!=dp[i//2]:
      print('No')
      exit()
print('Yes')