function s1(c)
  if c == "A" then
    return s2
  elseif c == "K" then
    return s3
  else
    return nil
  end
end
function s2(c)
  if c == "K" then
    return s3
  else
    return nil
  end
end
function s3(c)
  if c == "I" then
    return s4
  else
    return nil
  end
end
function s4(c)
  if c == "H" then
    return s5
  else
    return nil
  end
end
function s5(c)
  if c == "A" then
    return s6
  elseif c == "B" then
    return s7
  else
    return nil
  end
end
function s6(c)
  if c == "B" then
    return s7
  else
    return nil
  end
end
function s7(c)
  if c == "A" then
    return s8
  elseif c == "R" then
    return s9
  else
    return nil
  end
end
function s8(c)
  if c == "R" then
    return s9
  else
    return nil
  end
end
function s9(c)
  if c == "A" then
    return s10
  elseif c == "\n" then
    print("YES")
    os.exit(0)
  else
    return nil
  end
end
function s10(c)
  if c == "\n" then
    print("YES")
    os.exit(0)
  else
    return nil
  end
end

local s = s1
while true do
  local c = io.read(1)
  s = s(c)
  if not s then
    print("NO")
    break
  end
end