n = int(input())
s = 0
l = list(map(int,input().split()))
i = 0 
while i+2 <= len(l)-1:
  if l[i+1] == l[i]^l[i+2]:
    c=1
    i=i+1
  else:
    c=0
    i=i+1

if c==1:
  print("Yes")
else:
  print("No")