from collections import Counter

N = int(input())
As = list(map(int, input().split()))

def solve():
    if N % 3:
        print('No')
    else:
        m = N//3
        cnt = Counter(As)
        vs = []
        for v in cnt.keys():
            if cnt[v] % m:
                print('No')
                return
            vs += [v] * (cnt[v]//m)
#        print(vs)
        A, B, C = vs
#        print(A, B, C)
        if A^B^C:
            print('No')
        else:
            print('Yes')

solve()
