n=int(input())
a=list(map(int,input().split()))
if n%3!=0:
  if a.count(0)==n:
    print("Yes")
  else:
    print("No")
  exit()

for i in range(2,n):
  if (i+1)%3==0:
    if a[i]!=a[i-2]^a[i-1]:
      print("No")
      exit()
print("Yes")