local t = {
  {A=2,K=3},
  {K=3},
  {I=4},
  {H=5},
  {A=6,B=7},
  {B=7},
  {A=8,R=9},
  {R=9},
  {A=10,["\n"]=0},
  {["\n"]=0}
}
local s = 1
while s do
  local c = io.read(1)
  s = t[s][c]
  if not s then
    print("NO")
  elseif s == 0 then
    print("YES")
    s = nil
  end
end