aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from sys import stdin
s=stdin.readline().strip()
acum=[0 for i in range(len(s))]
dp=[0 for i in range(len(s)+1)]
last_b=0
mod=1000000007
for i in range(len(s)):
    if s[i]=='a':
        dp[i+1]=(1+acum[last_b])%mod
    elif s[i]=="b":
        last_b=i
    acum[i]=(acum[i-1]+dp[i+1])%mod
print(acum[-1])
