aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
mo = int(10e9+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
from itertools import accumulate
ma = list(accumulate(reversed(m)))
ma = list(reversed(ma))
for i, e in enumerate(m):
    if i==len(m)-1: sol+= (e%mo)
    else:sol += (e%mo) + ((e%mo)*(ma[i+1]%mo))%mo
print(sol%mo)
