n = int(input())
lst = list(map(int,input().split()))

flg = 1
sum = lst[-1]
for i in range(len(lst)):
  sum = sum ^ lst[i]
  if i+1 == len(lst):
    if bin(lst[i]) != bin(lst[i-1] ^ lst[0]):
      flg = 0
      #break
  elif bin(lst[i]) != bin(lst[i-1] ^ lst[i+1]):
    flg = 0
    #break
if sum == 0:
  print("Yes")
elif flg == 1:
  print("Yes")
else:
  print("No")