s=input()
from collections import defaultdict
d=defaultdict(int)
for c in s: 
  d[c]+=1
a,b,c=d["a"],d["b"],d["c"]
mx=max(a,b,c)
mn=min(a,b,c)
#a,b,c = map(lambda x:x-mn, [a,b,c])
if mx-mn >=2:
  print("NO")
else:
  print("YES")