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

# solution1
# for i, j in enumerate(s):
#     if j == 'a':
#         ans = add(a, ans)
#     elif j == 'b':
#         a = add(ans, 1)

# solution2
for i, j in enumerate(s):
    if j == 'a':
        a += 1
    elif a > 1:
        ans = (ans * a) % mod
        a = 1

ans = ((ans * a) % mod - 1) % mod

print(ans)
