from collections import Counter

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

if N % 3:
    print('No')
else:
    cnt = Counter(As)
    if len(cnt) != 3:
        print('No')
    else:
        nums = [cnt[i] for i in cnt.keys()]
#        print(nums)
        if len(set(nums)) != 1:
            print('No')
        else:
            A, B, C = cnt.keys()
#            print(A, B, C)
            if A^B^C:
                print('No')
            else:
                print('Yes')
