import java.lang.Math

fun main(args: Array<String>) {
    val S = readInputLine()

    var a = 0
    var b = 0
    var c = 0

    S.forEach {
        when (it) {
            'a' -> a++
            'b' -> b++
            'c' -> c++
        }
    }

    if (Math.abs(a - c) >= 2 || Math.abs(b - c) >= 2 || Math.abs(a - b) >= 2) {
        println("NO")
    } else {
        println("YES")
    }
}

fun readInputLine(): String {
    return readLine()!!
}
