aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

string = raw_input()
count = 0
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 = 0

total = sum(aux)
value = aux[0] if len(aux) > 0 else 0

for i in range(1, len(aux)):
    total += aux[i] * aux[i - 1]
    value *= aux[i]
    aux[i] += aux[i - 1]
    total = total % MOD
    value = value % MOD

if (len(aux) > 2):
    total += value

print(total)
