unittest
{
	assert( [ "KIHBR" ].parse.expand.solve == "YES" );
	assert( [ "AKIBAHARA" ].parse.expand.solve == "NO" );
	assert( [ "AAKIAHBAARA" ].parse.expand.solve == "NO" );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto s = input.front.to!( dchar[] );
	return tuple( s );
}

auto solve( dchar[] s )
{
	auto t = "AKIHABARA"d;
	while( !s.empty || !t.empty )
	{
		if( t.empty ) return "NO";
		if( s.empty )
		{
			if( t.front != 'A' ) return "NO";
			t.popFront;
		}
		else
		{
			if( s.front != t.front && t.front != 'A' ) return "NO";
			if( s.front == t.front ) s.popFront;
			t.popFront;
		}
	}
	return "YES";
}
