n = int(input())
lists = list(map(int,input().split()))

def xor(a,b):
    x = 0
    ma = max(len(str(a)),len(str(b)))
    for i in range(ma):
        a = str(a).rjust(ma,"0")
        b = str(b).rjust(ma,"0")     
        if a[-i-1] != b[-i-1]:
            x+= 10**i
        else:
            pass
    return x

bin_l = []
for i in lists:
    a = bin(i)
    b = int(a[2:])
    bin_l.append(b)

zero = bin_l.count(0)

if zero <=len(bin_l)//2:
    if 0 in bin_l :
        k = bin_l.remove(0)
        if len(k) == 2:
        
            if k[0] == k[1]:
                print("Yes")
            else:
                print("No")
        elif len(k)%3 ==0 and len(set(k)) == 3:
            l = list(set(k))
    
    
            if l[0] == xor(l[1],l[2]) and l[1] == xor(l[0],l[2]) and l[2] == xor(l[0],l[1]):
                print("Yes")
            else:
                print("No")
        else:
            pass
    else:
        if len(bin_l)%3 ==0 and len(set(bin_l)) == 3:
            l = list(set(bin_l))
    
    
            if l[0] == xor(l[1],l[2]) and l[1] == xor(l[0],l[2]) and l[2] == xor(l[0],l[1]):
                print("Yes")
            else:
                print("No")   
        else:
            print("No")     

else:
    print("No")
