from collections import Counter
N = int(input())
A = list(map(int, input().split()))
ret = 'No'
c = Counter(A)
if all([i == 0 for i in c]):
    ret = 'Yes'
else:
    v = set(list([i[1] for i in c.items()]))
    if len(c) == 3 all([i == N/3 for i in v]):
        ret = 'Yes'
    elif len(c) == 2 and 0 in c:
        for i in c.items():
            if i[0] == 0 and i[1] == N/3:
                ret = 'Yes'

print(ret)