import re

l = re.compile("^A?KIHA?BA?RA?$").findall(eval(input()))

if l:

	print("YES")

else:

	print("NO")

S = eval(input())

strings = ["AKIHABARA", "KIHABARA", "AKIHBARA", "AKIHABRA", "AKIHABAR", "KIHBARA", "KIHABRA", "KIHABAR", "AKIHBRA", "AKIHBAR", "AKIHABR", "AKIHBR", "KIHABR", "KIHBAR", "KIHBRA", "KIHBR"]

if S in strings:

	print("YES")

else:

	print("NO")

import re

l = re.compile("^A?KIHA?BA?RA?$").findall(eval(input()))
if l:
    print("YES")
else:
    print("NO")

S = eval(input())
strings = [
    "AKIHABARA",
    "KIHABARA",
    "AKIHBARA",
    "AKIHABRA",
    "AKIHABAR",
    "KIHBARA",
    "KIHABRA",
    "KIHABAR",
    "AKIHBRA",
    "AKIHBAR",
    "AKIHABR",
    "AKIHBR",
    "KIHABR",
    "KIHBAR",
    "KIHBRA",
    "KIHBR",
]
if S in strings:
    print("YES")
else:
    print("NO")

-import re - -l = re.compile("^A?KIHA?BA?RA?$").findall(eval(input())) -if l: +S = eval(input()) +strings = [ +    "AKIHABARA", +    "KIHABARA", +    "AKIHBARA", +    "AKIHABRA", +    "AKIHABAR", +    "KIHBARA", +    "KIHABRA", +    "KIHABAR", +    "AKIHBRA", +    "AKIHBAR", +    "AKIHABR", +    "AKIHBR", +    "KIHABR", +    "KIHBAR", +    "KIHBRA", +    "KIHBR", +] +if S in strings: