S = input()

import collections as col
cc = col.Counter(S)

mi = 10000000000000000
ma = -1000
for k,v in cc.items():
  mi = min(mi,v)
  ma = max(ma,v)
if ( len(cc.keys())<3 ):
  mi = 0
 
if (ma-mi<=1):
  print ("YES")
else:
  print ("NO")
  