aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

'''input
abbaa
'''
import math
from fractions import gcd
mod=10**9+7
s=raw_input()
x=0
a=[]

for i in range(len(s)):   
    if (s[i])=='b':
        #print x
        if x>0:
            a.append(x)
            x=0
    elif s[i]=='a':
        x+=1
if x:
    a.append(x)
a=a[::-1]
#print a
t=1
res=0
for i in range(len(a)):
    res=res+t*a[i]
    res=res%mod
    t=res+1
    t=t%mod
print res%mod


