n=int(input())
a=list(map(int,input().split()))
a.sort()
b=set(a)
l=len(b)
if l==2:
  c=sorted([b.pop(),b.pop()])
  if c[1]^c[0]==c[1]:
    if n%2==0 and a[n//2-1]!=a[n//2]:print("Yes")
    else:print("No")
  else:print("No")
  exit()
elif l==1:
  if a[0]==0:print("Yes")
  else:print("No")
  exit()
elif l!=3:print("No");exit()
if n%3!=0:print("No");exit()
if b.pop()^b.pop()^b.pop()!=0:print("No");exit()
m=n//3
if a[m-1]!=a[m]and a[m*2-1]!=a[m*2]:print("Yes")
else:print("No")