n=int(input())
a=[int(_) for _ in input().split()]

if n==3:
  print('Yes') if a[2]==(a[0]^a[1]) else print('No')
  exit()

if n==4:
  print('No')
  exit()
  
def j(n,a):
#  print(a)
  for i in range(n-1):
    if a[i]!=a[i-1]^a[i+1]:
#      print(a[i],a[i-1],a[i+1])
      return False
  if a[n-1]!=a[n-2]^a[0]:
#    print(a[n-1],a[n-2],a[0])
    return False
  return True

def mp(n,m=0):
  if n==m:
    _a=[a[_-1] for _ in pe]
    r=j(n,_a)
    if r: 
      print('Yes')
      exit()
    
  else:
    for x in range(1,n+1):
      if x in pe: continue
      pe.append(x)
      mp(n,m+1)
      pe.pop()

pe=[]
mp(n)
print('No')