n = int(input())
figure = list(map(int, input().split()))
p=0
for i in range(n-1):
  if(i==0):
    if(figure[n-1]^figure[i+1]==figure[i]):
      print("No")
      p+=1
      break
  else:
    if(figure[i-1]^figure[i+1]!=figure[i]):
      print("No")
      p+=1
      break
if(p==0):
  print("Yes")