aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import math

s = input()
n = len(s)

mod = 1000000007
ans = 1
cnt = 0
f = 0
for i in range(n):
    if s[i]=='a':
        cnt = cnt + 1
    if s[i]=='b':
        ans = (ans * (cnt+1)) % mod
        cnt = 0
if cnt:
    ans = (ans * (cnt+1)) % mod

print((ans+mod-1)%mod)
