import sys
input = sys.stdin.readline

def main():
    N = input()
    A = [int(a) for a in input().split()]
    dic = {}     
    
    for a in A:
        dic[a] = dic.get(a,0)+1
        
    if len(dic)!=3:   
        print("No")
    else:
        key = []
        for k in dic:
            key.append(k)
        if key[0]^key[1] != key[2]:               
            print("No")
        else:
            if dic[key[0]]==dic[key[1]]==dic[key[2]]:                  
                print("Yes")
            else:
                print("No")
    
    
if __name__ == '__main__':
    main()   
