aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from functools import reduce
from operator import mul

MOD = 10**9 + 7

A = input()

nums = []

current = 0

for x in A:
    if x == 'a':
        current += 1
    elif x == 'b' and current != 0:
        nums += [current + 1]
        current = 0

if current != 0:
    nums += [current + 1]

if len(nums) == 0:
    print(0)
else:
    print(reduce(lambda x, y: (x * y % MOD), nums) - 1)
