import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val s = sc.next().toCharArray()

  var countA = 0
  var countB = 0
  var countC = 0
  for (c in s) {
    if(c == 'a') countA++
    if(c == 'b') countB++
    if(c == 'c') countC++
  }

  val array = arrayOf(countA, countB, countC)
  val min = array.min()!!
  val max = array.max()!!

  if (max - min <= 1) {
    println("YES")
    return
  }
  println("NO")

}
