import collections
n=int(input())
A=[int(i) for i in input().split()]
AA=collections.Counter(A)
AK=AA.keys()
AV=AA.values()

ans=True
if n%3!=0:
  ans=False
else:
  nn=n//3
  if len(AK)!=3:
    ans=False
  else:
    a,b,c=AK
    if AA[a]!=nn or AA[b]!=nn or AA[c]!=nn:
      ans=False
    else:
      if a^b!=c or b^c!=a:
        ans=False
print("Yes" if ans==True else "No")

