{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf
import Debug.Trace

readInt = ( readLn :: IO Int )
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = getLine >>= putStrLn . which "YES" "NO" . solve "AKIHABARA"

solve [] [] = True
solve [c] [] = c == 'A'
solve [] _ = False
solve _ [] = False
solve (c1:t) ss@(c2:s)
	| c1 == c2 = solve t s
	| c1 == 'A' = solve t ss
	| otherwise = False