S = input()
ca = S.count("a")
cb = S.count("b")
cc = S.count("c")
n = min(ca,cb,cc)
ca2 = ca - n
cb2 = cb - n
cc2 = cc - n
flg = [ca2,cb2,cc2]
flg.sort()
if flg in [[0,0,0],[0,0,1],[0,1,1]]:
  print("YES")
else:
  print("NO")