from collections import Counter
n = int(input())
A = list(map(int, input().split()))
ans = "Yes"
Co = Counter(A)
if n%3 != 0:
    if len(Co.keys()) != 1 or list(Co.keys())[0] != 0:
        ans = "No"
else:
    tr = n//3
    Va = Co.values()
    if len(Va) > 3: ans = "No"
    if len(Va) == 3:
        if not(Co.most_common()[0][1] == Co.most_common()[1][1] == Co.most_common()[2][1]):
            ans = "No"
    elif len(Va) != 2 or Co.most_common()[0][1] != 2*Co.most_common()[1][1]:
        ans = "No"
    elif len(Va) != 1 or Co.most_common()[0][0] != 1:
        ans = "No"

print(ans)