N = int(input())
A = list(map(int,input().split()))
dic = {}
if N%3 == 0:
    for a in A:
        if a not in dic:
            dic[a] = 1
        else:
            dic[a] += 1
    if len(dic) == 3:
        flag = True
        for d in dic.values():
            if d != N//3:
                flag = False
        temp = []
        for d in dic:
            temp.append(d)
        
        if flag and temp[0]^temp[1] == temp[2]:
            print('Yes')
        else:
            print('No')

    else:
        print('No')
    
else:
    print('No')