void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  auto s=readln.chomp.to!(char[]);

  if(s.length>"AKIHABARA".length){
    writeln("NO"); return;
  }

  auto cs=['K', 'I', 'H', 'B', 'R'];
  foreach(c; s)foreach(c1; cs){
    if(c!=c1 && c!='A'){writeln("NO"); return;}
  }
  auto cnt1=new int[](cs.length);
  foreach(c; s)foreach(i, c1; cs){
    if(c==c1) cnt1[i]++;
  }
  foreach(e; cnt1){
    if(e!=1){writeln("NO"); return;}
  }
  long idx=-1;
  foreach(c; cs){
    auto jdx=indexOf(s, c);
    if(jdx==-1){writeln("NO"); return;}
    if(idx>=jdx){writeln("NO"); return;}
    idx=jdx;
  }

  auto cnt=new long[](cs.length+1);
  cnt[0]=indexOf(s, cs[0]);
  foreach(i; 1..cs.length){
    cnt[i]=indexOf(s, cs[i])-indexOf(s, cs[i-1])-1;
  }
  cnt[$-1]=s.length-indexOf(s, cs[$-1])-1;
  auto ok=[1, 0, 0, 1, 1, 1]; assert(ok.length==cnt.length);
  foreach(i; 0..cnt.length){
    if(cnt[i]>ok[i]){writeln("NO"); return;}
  }
  writeln("YES");
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}