aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

string = raw_input()
count = 1
MOD = 10 ** 9 + 7
aux = []
string += 'b'

for i in range(len(string)):
    if (string[i] == 'a'):
        count += 1
    if (string[i] == 'b' and count > 0):
        aux.append(count)
        count = 1

total = 1

for i in aux:
    total *= i
    total = total % MOD

print((total - 1) % MOD)
