def find(A):
    dic={}
    for i in range(len(A)):
        if A[i] in dic:
            dic[A[i]]+=1
        else:
            dic[A[i]]=1
    if len(dic)==1:
        if 0 in dic:
            return True
        else:
            return False
    
    if len(dic)==2:
        if N%3!=0:
            return False
        temp=[]
        for x in dic:
            temp+=[dic[x]]
        n=N//3
        temp=sorted(temp)
        if (temp[0],temp[1])!=(n,2*n):
            return False
        
        if 0 not in dic:
            return False
        
        n1=dic[0]
        if n1==n:
            return True
        return False
    
    if len(dic)>3:
        return False
    
    if len(dic)==3 and N%3!=0:
        return False
    
    temp=[dic[x] for x in dic]
    if temp[0]!=temp[1] or temp[1]!=temp[2] or temp[2]!=temp[0]:
        return False
    
    a,b,c=[x for x in dic]
    if a^b==c or b^a==c or c^b==a:
        return True
    return False
    
input()
A=list(map(int,input().strip().split(' ')))
if find(A):
    print("Yes")
else:
    print("No")