aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
mo = int(1e9+7)
import re
s = re.sub('b+','b',s)
if s[0] == 'b' : s = s[1:]
if s[-1] == 'b' : s = s[:-1]
m = list(filter(lambda x: x is 'b' or x is 'a',s))
s = ''.join(m).split('b')
m = [len(i) for i in s]
sol = [0]*(len(m)+1)
# print(m)
for i in range(1,len(sol)):
    sol[i] = (((m[i-1]%mo) + (sol[i-1]*m[i-1])%mo)%mo + (sol[i-1]%mo))%mo
print(sol[len(m)]%mo)
