N = int(input())
a = list(map(int, input().split()))

flag = True
for i in range(1, N-1):
  if a[i-1]^a[i+1] != a[i]:
    flag = False
    break
    
if flag:
  if a[1]^a[-1] != a[0]:
    flag = False
  if a[0]^a[-2] != a[-1]:
    flag = False
    
if flag:
  print('Yes')
else:
  print('No')