n = int(input())
list1 = list(map(int,input().split()))
list1.insert(0,list1[n-1])
list1.append(list1[1])
for i in range(n):
  for j in range(n):
    flag = 1
    if list1[i]^list1[j] == list1[i+1]:
      flag = 0
      break;
  if flag==1:
    break;
if flag != 1:
  print("Yes")
else:
  print("No")