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

from collections import Counter

c=Counter(a)

v=list(c.values())
k=list(c.keys())

v=sorted(v)

if len(k)==3:
    ans='Yes'
    for i in range(3):
        if v[i]!=n/3:
            ans='No'
            break
    print(ans)
elif len(k)==2 and v[0]==n//3 and v[1]==2*n//3:
    print('Yes')
elif len(k)==1 and k[0]==0:
    print('Yes')
else:
    print('No')