aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s  = input()


numb = 0

n = s.count('a')




def int_contains_b(left,right):

    if(s[left:right].count('b')>0):
        return True
    else:
        return False




def get_next_a(index,s):

    for i in range(index+1,len(s)):

        if(s[i]=='a'):
            return i
    return -1


def conseq(index,s):

    consq = 0

    for i in range(index, len(s)):

        if (s[i] == 'a'):
            consq +=1
        else:
            return consq
    return consq



i = 0

while(i<len(s)):

    if(s[i]=='a'):

        next_a  = get_next_a(i,s)
        con = conseq(next_a,s)


        if(next_a == -1):
            break
        else:


            if(next_a - i > 1 and int_contains_b(i,next_a)):

                i += con + next_a
                numb += con %(10**9 +7)

            else:
                i+=conseq(i,s)
                numb += conseq(i,s) %(10**9 +7)

    else:
        i+=1



numb+=n%(10**9 +7)
print(numb)





