import java.util.*

fun main(args: Array<String>) {
    val S = readLine()!!
    val T = "AKIHABARA"
    val U = "KIHBR"
    val st = TreeSet<String>()

    for (s in 0 until (1 shl T.length)) {
        val sb = StringBuilder()
        for (j in T.indices) {
            if (s and (1 shl j) != 0) {
                sb.append(T[j])
            }
        }
        val s = sb.toString()
        if (s.filter {it != 'A'} != U) {
            continue
        }
        st.add(s)
    }

    if (st.contains(S)) {
        println("YES")
    } else {
        println("NO")
    }
}
