local s = io.read()
local n = #s
local pos = 1
local f = false

pos = s:find("KIH", pos)
if pos == 1 or (pos == 2 and s:sub(1, 1) == "A") then
  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
          if rpos == n or (rpos == n - 1 and s:sub(n, n) == "A") then
            f = true
          end
        end
      end
    end
  end
end

print(f and "YES" or "NO")
