import sys
n = int(input())
a = list(map(int,input().split()))
for i in range(1,n-1):
  if not a[i] == a[i-1]^a[i+1]:
    print("No")
    sys.exit()
if a[0] == a[-1]^a[1] and a[-1] == a[0]^a[-2]: 
  print("Yes")
else:
  print("No")