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 = rstr(), 0, 10 ** 9 + 7, 1, 0

for i, j in enumerate(s):
    if j == 'a':
        ans, b = add(a, ans), 1
    elif j == 'b':
        if b:
            a *= 2
            b = 0
print(ans)
