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 == "AKIHABARA"
  where
    go [] = []
    go [x]
      | x == 'R' = "RA"
      | otherwise = [x]
    go (x:y:[])
      | x == 'R' && y == 'A' = "RA"
      | x == 'A' && y == 'R' = "ARA"
      | x == 'B' && y == 'R' = "BARA"
      | otherwise = [x, y]
    go (x:y:z:xs)
      | x == 'A' && y == 'K' && z == 'I' = "AKI" ++ go xs
      | x == 'K' && y == 'I' && z == 'H' = "AKIHA" ++ go xs
      | x == 'I' && y == 'H' = "IH" ++ go (z:xs)
      | x == 'H' && y == 'A' = "HA" ++ go (z : xs)
      | x == 'H' && y == 'B' = "HAB" ++ go (z : xs)
      | x == 'B' && y == 'A' = "BA" ++ go (z : xs)
      | x == 'B' && y == 'R' = "BARA" ++ go (z : xs)
      | otherwise = x : go (y:z:xs)
