from collections import Counter

N = int(input())

A = list(map(int, input().split()))
c = Counter(A)
a = list(set(A))


if len(a) >= 4:
    ans = False

elif len(a) == 3:
    ans = True
    for i in c.values():
        if i != N/3:
            ans = False
            break

elif len(a) == 2:
    if c.most_common()[0][0] == 0 and c.most_common()[0][1] == (3/N)*2 and c.most_common()[1][1] == N/3:
        ans = True
    else:
        ans = False

elif len(a) == 1:
    if a == [0]:
        ans = True
    else:
        ans = False

print("Yes" if ans else "No")
