from collections import Counter
N = int(input())
A = list(map(int, input().split()))
ret = 'No'
c = Counter(A)
# for i in c.items():
#     print(i)
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:
        if len(v) == 1:
            ret = 'Yes'
    elif len(c) == 4:
        cnt = []
        for i in c.items():
            if i[0] != 0:
                cnt.append(i[1])
        if len(set(cnt)) == 1:
            ret = 'Yes'
print(ret)