local s = io.read()
local n = #s
local pos = 1
local f = false
while pos do
  pos = s:find("KIH", pos)
  if not pos then break end
  if n - 4 < pos then break end
  pos = pos + 3
  local bpos = s:find("B", pos)
  if bpos and bpos < n then
    if bpos == pos or (bpos == pos + 1 and s:sub(pos, pos) == "A") then
      local rpos = s:find("R", bpos)
      if rpos then
        if rpos == bpos + 1 or (rpos == bpos + 2 and s:sub(bpos + 1, bpos + 1) == "A") then
          f = true
          break
        end
      end
    end
  end
end
print(f and "YES" or "NO")
