import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val in = new Scanner(System.in)
    val s = (in.next() + "?").toCharArray
    val t = "AKIHABARA?".toCharArray
    var i = 0
    var j = 0
    while (s(i) != '?' && t(j) != '?') {
      if (s(i) == t(j)) {
        i += 1
        j += 1
      } else if (t(j) == 'A') {
        j += 1
      } else {
        println("NO")
        return
      }
    }

    if (s(i) == '?') {
      println("YES")
    } else {
      println("NO")
    }
  }
}
