S=eval(input())



pos={"AKIHABARA","KIHABARA","AKIHBARA","KIHBARA","AKIHABRA","KIHABRA","AKIHBRA","KIHBRA","AKIHABAR","KIHABAR","AKIHBAR","KIHBAR","AKIHABR","KIHABR","AKIHBR","KIHBR"}

     

if S in pos:

  print("YES")

else:

  print("NO")

S=eval(input())

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

print(("YES" if A.count(S)>=1 else "NO"))
S = eval(input())
pos = {
    "AKIHABARA",
    "KIHABARA",
    "AKIHBARA",
    "KIHBARA",
    "AKIHABRA",
    "KIHABRA",
    "AKIHBRA",
    "KIHBRA",
    "AKIHABAR",
    "KIHABAR",
    "AKIHBAR",
    "KIHBAR",
    "AKIHABR",
    "KIHABR",
    "AKIHBR",
    "KIHBR",
}
if S in pos:
    print("YES")
else:
    print("NO")

S = eval(input())
A = [
    "AKIHABARA",
    "KIHABARA",
    "AKIHBARA",
    "KIHBARA",
    "AKIHABRA",
    "KIHABRA",
    "AKIHBRA",
    "KIHBRA",
    "AKIHABAR",
    "KIHABAR",
    "AKIHBAR",
    "KIHBAR",
    "AKIHABR",
    "KIHABR",
    "AKIHBR",
    "KIHBR",
]
print(("YES" if A.count(S) >= 1 else "NO"))

-pos = { +A = [ -} -if S in pos: -    print("YES") -else: -    print("NO") +] +print(("YES" if A.count(S) >= 1 else "NO"))