import kotlin.math.abs

fun main(args: Array<String>) {
    val s = readString()

    val a = s.count { it == 'a' }
    val b = s.count { it == 'b' }
    val c = s.count { it == 'c' }

    val ans = when {
        a == 1 && b == 1 && c == 1
                || a == 0 && b == 1 && c == 1
                || a == 1 && b == 0 && c == 1
                || abs(a - b) <= 1 && abs(b - c) <= 1 && abs(c - a) <= 1 -> "YES"
        else -> "NO"
    }
    println(ans)
}

// read
fun readString() = readLine()!!