import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val in = new Scanner(System.in)
    val s = in.next().toCharArray

    var a = 0
    var b = 0
    var c = 0
    s.foreach(x => if (x == 'a') {
      a += 1
    } else if (x == 'b') {
      b += 1
    } else {
      c += 1
    })

    val min = math.min(a, math.min(b, c))
    a -= min
    b -= min
    c -= min
    if (math.max(a, math.max(b, c)) > 1) {
      println("NO")
    } else {
      println("YES")
    }
  }
}
