from collections import Counter

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

A = Counter(A)
V = Counter(A.values())

if len(A)==3 and len(V)==1:
    p,q,r = A.keys()
    if p^q^r == 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')
