N = int(input())    
data = list(map(lambda x: int(x), input().split(" ")))    
    
def yes():    
    print("Yes")    
    
def no():    
    print("No")    
    
dic = {}    
for i in data:    
    if i in dic:    
        dic[i] += 1    
    else:    
        dic[i] = 1    
    
keys = list(dic.keys())    
if len(keys) == 1 and keys[0] == 0:    
    yes()    
elif len(keys) == 3:    
    a = keys[0]    
    b = keys[1]    
    c = keys[2]    
    if a ^ b == c and dic[a] == dic[b] and dic[b] == dic[c]:    
        yes()    
    else:    
        no()    
else:    
    no()  