
import collections as col
N=int(input())
A=[ai for ai in map(int,input().split())]
Ans=False
if len(A)%3==0:
    CA=col.Counter(A)
    if len(CA)==3:
        K=list(CA.keys())
        if (K[0]^K[1]==K[2]) and (CA[K[0]]==CA[K[1]]==CA[K[2]]):
            Ans=True
    elif len(CA)==2:
        K=list(sorted(CA.keys()))
        if CA[K[0]]*2==CA[K[1]]:
            Ans=True
    elif len(CA)==1 and 0 in CA:
        Ans=True

print("Yes" if Ans==True else "No")
