#include<bits/stdc++.h>
using namespace std;
string a,yl="AKIHABARA";
int now,k;
int main()
{
	cin>>a;
	for(int s=0;s<a.size();s++)
	{
		if(a[s]==yl[now])
		{
			now++;
		}
		else
		{
			if(s>0)
			if(a[s]==a[s-1])
			{
				cout<<"NO"<<endl;
				exit(0);
			}
			if(yl[now]=='A')now++,s--;
			else
			{
				cout<<"NO"<<endl;
				exit(0);
			}
		}
	}
	k=a.size();
	for(int s=0;s<a.size();s++)
	{
		if(a[s]=='A')k--;
	}
	if(k==5)
	cout<<"YES"<<endl;
	else
	cout<<"NO"<<endl;
}