fun main(args : Array<String>) {
    val s = readLine()!!
    val ss = mutableMapOf('a' to 0, 'b' to 0, 'c' to 0)

    s.forEach {
        ss[it] = ss[it]?.plus(1) ?: 0
    }

    val diffAB = Math.abs(ss['a']!! - ss['b']!!)
    val diffAC = Math.abs(ss['a']!! - ss['c']!!)
    val diffBC = Math.abs(ss['b']!! - ss['c']!!)

    if (diffAB in 0..1 && diffAC in 0..1 && diffBC in 0..1) {
        println("YES")
    } else {
        println("NO")
    }
}