s=input()
dic={}
for c in s:
    if c in dic:
        dic[c]+=1
    else:
        dic[c]=1
if len(dic)==1:        
    print('YES')
elif len(dic)==2:
    print('NO')
else:
    a,b,c=sorted(dic.values())
    if max(abs(a-b),abs(b-c),abs(c-a))<=1:
        print('YES')
    else:
        print('NO')