import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7



def LI(): return list(map(int,input().split()))

def II(): return int(eval(input()))

def LS(): return input().split()

def S(): return eval(input())



def main():

  s=S()



  if len(s)<5:

    print('NO')

  else:

    if s[-4:]=='BARA':

      if s.count('A')>4:

        print('NO')

      elif s.count('A')==4:

        if s=='AKIHABARA':

          print('YES')

        else:

          print('NO')

      else:

        if s.count('KIH')==1:

          print('YES')

        else:

          print('NO')



    elif s[-3:]=='BRA' or s[-3:]=='BAR':

      if s.count('A')>3:

        print('NO')

      elif s.count('A')==3:

        if s=='AKIHABRA' or s=='AKIHABAR':

          print('YES')

        else:

          print('NO')

      else:

        if s.count('KIH')==1:

          print('YES')

        else:

          print('NO')



    elif s[-2:]=='BR':

      if s.count('A')>2:

        print('NO')

      elif s.count('A')==2:

        if s=='AKIHABR':

          print('YES')

        else:

          print('NO')

      else:

        if s.count('KIH')==1:

          print('YES')

        else:

          print('NO')

    else:

      print('NO')



main()

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7

dd=[(-1,0),(0,1),(1,0),(0,-1)]

ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]



def LI(): return [int(x) for x in sys.stdin.readline().split()]

def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]

def I(): return int(sys.stdin.readline())

def LS(): return sys.stdin.readline().split()

def S(): return eval(input())



def main():

  s=S()



  if len(s)>9:

    return 'NO'

  if len(s)==9:

    if s=='AKIHABARA':

      return 'YES'

    return 'NO'

  if len(s)==8:

    if s=='KIHABARA' or s=='AKIHBARA' or s=='AKIHABRA' or s=='AKIHABAR':

      return 'YES'

    return 'NO'

  if len(s)==7:

    if s=='KIHBARA' or s=='KIHABRA' or s=='KIHABAR' or s=='AKIHBRA' or s=='AKIHBAR' or s=='AKIHABR':

      return 'YES'

    return 'NO'

  if len(s)==6:

    if s=='KIHBRA' or s=='KIHABR' or s=='KIHBAR' or s=='AKIHBR':

      return 'YES'

    return 'NO'

  if len(s)==5:

    if s=='KIHBR':

      return 'YES'

    return 'NO'

  else:

    return 'NO'



# main()

print((main()))

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7


def LI():
    return list(map(int, input().split()))


def II():
    return int(eval(input()))


def LS():
    return input().split()


def S():
    return eval(input())


def main():
    s = S()
    if len(s) < 5:
        print("NO")
    else:
        if s[-4:] == "BARA":
            if s.count("A") > 4:
                print("NO")
            elif s.count("A") == 4:
                if s == "AKIHABARA":
                    print("YES")
                else:
                    print("NO")
            else:
                if s.count("KIH") == 1:
                    print("YES")
                else:
                    print("NO")
        elif s[-3:] == "BRA" or s[-3:] == "BAR":
            if s.count("A") > 3:
                print("NO")
            elif s.count("A") == 3:
                if s == "AKIHABRA" or s == "AKIHABAR":
                    print("YES")
                else:
                    print("NO")
            else:
                if s.count("KIH") == 1:
                    print("YES")
                else:
                    print("NO")
        elif s[-2:] == "BR":
            if s.count("A") > 2:
                print("NO")
            elif s.count("A") == 2:
                if s == "AKIHABR":
                    print("YES")
                else:
                    print("NO")
            else:
                if s.count("KIH") == 1:
                    print("YES")
                else:
                    print("NO")
        else:
            print("NO")


main()

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI():
    return [int(x) for x in sys.stdin.readline().split()]


def LI_():
    return [int(x) - 1 for x in sys.stdin.readline().split()]


def I():
    return int(sys.stdin.readline())


def LS():
    return sys.stdin.readline().split()


def S():
    return eval(input())


def main():
    s = S()
    if len(s) > 9:
        return "NO"
    if len(s) == 9:
        if s == "AKIHABARA":
            return "YES"
        return "NO"
    if len(s) == 8:
        if s == "KIHABARA" or s == "AKIHBARA" or s == "AKIHABRA" or s == "AKIHABAR":
            return "YES"
        return "NO"
    if len(s) == 7:
        if (
            s == "KIHBARA"
            or s == "KIHABRA"
            or s == "KIHABAR"
            or s == "AKIHBRA"
            or s == "AKIHBAR"
            or s == "AKIHABR"
        ):
            return "YES"
        return "NO"
    if len(s) == 6:
        if s == "KIHBRA" or s == "KIHABR" or s == "KIHBAR" or s == "AKIHBR":
            return "YES"
        return "NO"
    if len(s) == 5:
        if s == "KIHBR":
            return "YES"
        return "NO"
    else:
        return "NO"


# main()
print((main()))

-import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time +import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy +dd = [(-1, 0), (0, 1), (1, 0), (0, -1)] +ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)] -    return list(map(int, input().split())) +    return [int(x) for x in sys.stdin.readline().split()] -def II(): -    return int(eval(input())) +def LI_(): +    return [int(x) - 1 for x in sys.stdin.readline().split()] + + +def I(): +    return int(sys.stdin.readline()) -    return input().split() +    return sys.stdin.readline().split() -    if len(s) < 5: -        print("NO") +    if len(s) > 9: +        return "NO" +    if len(s) == 9: +        if s == "AKIHABARA": +            return "YES" +        return "NO" +    if len(s) == 8: +        if s == "KIHABARA" or s == "AKIHBARA" or s == "AKIHABRA" or s == "AKIHABAR": +            return "YES" +        return "NO" +    if len(s) == 7: +        if ( +            s == "KIHBARA" +            or s == "KIHABRA" +            or s == "KIHABAR" +            or s == "AKIHBRA" +            or s == "AKIHBAR" +            or s == "AKIHABR" +        ): +            return "YES" +        return "NO" +    if len(s) == 6: +        if s == "KIHBRA" or s == "KIHABR" or s == "KIHBAR" or s == "AKIHBR": +            return "YES" +        return "NO" +    if len(s) == 5: +        if s == "KIHBR": +            return "YES" +        return "NO" -        if s[-4:] == "BARA": -            if s.count("A") > 4: -                print("NO") -            elif s.count("A") == 4: -                if s == "AKIHABARA": -                    print("YES") -                else: -                    print("NO") -            else: -                if s.count("KIH") == 1: -                    print("YES") -                else: -                    print("NO") -        elif s[-3:] == "BRA" or s[-3:] == "BAR": -            if s.count("A") > 3: -                print("NO") -            elif s.count("A") == 3: -                if s == "AKIHABRA" or s == "AKIHABAR": -                    print("YES") -                else: -                    print("NO") -            else: -                if s.count("KIH") == 1: -                    print("YES") -                else: -                    print("NO") -        elif s[-2:] == "BR": -            if s.count("A") > 2: -                print("NO") -            elif s.count("A") == 2: -                if s == "AKIHABR": -                    print("YES") -                else: -                    print("NO") -            else: -                if s.count("KIH") == 1: -                    print("YES") -                else: -                    print("NO") -        else: -            print("NO") +        return "NO" -main() +# main() +print((main()))