import Data.List

main :: IO ()
main = do
  str <- getLine
  let n = length str
  putStrLn $ if  length "KIHBR" <= n
    && n <= length "AKIHABARA"
    && solve str then "YES" else "NO"

solve :: String -> Bool
solve str = go str == "KIHBR" && f str && g str
  where
    f ss = all (\ls -> length ls == 1) $
           group ss
    go ss = map head $
            filter (\ls -> head ls /= 'A') $
            group ss
    g ss = isInfixOf "KIH" ss
