#include <iostream>
using namespace std;

int main() {
    string s; cin >> s;
    string tar = "AKIHABARA";
    int i = 0, j = 0;
    while (i < (int) s.size() || j < (int) tar.size()) {
        if (i < (int) s.size() && j < (int) tar.size() && s[i] == tar[j]) {
            ++i;
            ++j;
        } else if (j < (int) tar.size() && tar[j] == 'A') {
            tar.erase(j, 1);
        } else {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << (tar == s ? "YES" : "NO");
}
