aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

text = input()
n, MOD = len(text), 10 ** 9 + 7

arr, cur = [], 0

for l in text:
    if l == 'a':
        cur += 1
    elif l == 'b':
        if cur > 0:
            arr.append(cur)
        cur = 0

if cur > 0:
    arr.append(cur)

ans = 1

for v in arr:
    ans *= (v + 1)
    ans %= MOD

print(ans - 1)


