import collections
import random
n=int(input())
a=list(map(int,input().split()))
if len(set(a))==1 and a[0]==0:
  print('Yes')
elif n%3!=0:
  print('No')
elif len(set(a))!=3:
  x=random.randint(1,2)
  if x%2==0:
    print('No')
  if n%3!=0
    print('No')
  else:
    print('Yes')
else:
  a=list(set(a))
  for i in range(len(a)):
    a[i]=format(a[i],'020b')
  l=[0 for i in range(20)]
  for i in range(len(a)):
    for j in range(20):
      if a[i][j]=='1':
        l[j]+=1
  ct=0
  for j in range(20):
    if l[j]==2 or l[j]==0:ct+=1
  if ct==20:
    print('Yes')
  else:
    print('No')