fun main(args: Array<String>) {
    val S = readLine()!!
    val ac = S.count { it == 'a' }
    val bc = S.count { it == 'b' }
    val cc = S.count { it == 'c' }
    val aa = listOf(ac, bc, cc).sorted()

    if (aa.last() - aa.first() > 1) {
        println("NO")
    } else {
        println("YES")
    }
}
