{-# LANGUAGE BangPatterns, MultiWayIf #-}

import Control.Applicative
import Control.Monad
import Data.List
import Debug.Trace (traceShow)
import qualified Data.ByteString.Char8 as B
readi b | Just (n, _) <- B.readInt b = n

solve :: String -> Bool
solve ss = go ss "AKIHABARA"
  where
    go "" ys
        | null (filter (/= 'A') ys) = True
        | otherwise                 = False
    go ('A':xs) ('A':ys) = go xs ys
    go (x:xs)   ('A':ys) = go (x:xs) ys
    go (x:xs)   (y:ys)
        | x == y    = go xs ys
        | otherwise = False

main :: IO ()
main = do
    ss <- getLine
    if solve ss
        then putStrLn "YES"
        else putStrLn "NO"