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