aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from sys import stdin

rstr = lambda: stdin.readline()[:-1]
add = lambda a, b: (a % mod + b % mod) % mod

s, ans, mod, a, b, lst = rstr(), 0, 10 ** 9 + 7, 0, 0, 0

for i, j in enumerate(s):
    if j not in 'ab':
        a, b, lst = 0, 0, 0
    elif j == 'a':
        ans = add(1, ans)
        if b:
            ans = add(ans, lst)
        a += 1
    else:
        b = 1
        if a:
            lst += a
            a = 0

print(ans)
