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