aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s=input()
a=[]
b=[]
for i in range(len(s)):
    if(s[i]=='a'):
        a.append(i)
    if(s[i]=='b'):
        b.append(i)
dp=[0 for i in range(len(a))]
dp[0]=1
i=a[0]+1
flag=0
t=1
while(i<len(s)):
    if(s[i]=='b'):
        flag=1
    if(s[i]=='a'):
        if(flag==1):
            dp[t]=(dp[t-1]*2)%(10**9+7)
        else:
            dp[t]=dp[t-1]
        t+=1
        flag=0
    i+=1
print(sum(dp)%(10**9+7))
