fun main(args: Array<String>) {
    val a = "AKIHABARA"
    val used = Array(a.length) {false}
    val b = readLine()!!
    var ai = 0
    var bi = 0
    while (ai < a.length && bi < b.length) {
        if (a[ai] == b[bi]) {
            used[ai] = true
            ai++
            bi++
        } else {
            ai++
        }
    }
    val onlyA = a.filterIndexed { idx, c -> !used[idx] }.any { it != 'A' }.not()
    println(if (bi == b.length && onlyA) "YES" else "NO")
}