# your code goes here
n=int(input())
arr=list(map(int,input().split()))
f=True
arr.append(arr[0])
arr.append(arr[1])
arr.append(arr[2])

for i in range(n):
  if(arr[i]^arr[i+1]==arr[i+2]):
    continue
  else:
    f=False
    break
if f:
  print("Yes")
else:
  print("No")
