strlist = list(input())
a, b, c = [0, 0, 0]
for i in strlist:
  if i == "a":
    a += 1
  if i == "b":
    b += 1
  if i == "c":
    c += 1
if max(a, max(b, c)) - min(a, min(b, c)) <= 1:
  print("YES")
else:
  print("NO")