aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s=input()
n=len(s)
dp=[0]*(n+1)
last=-1
dp[0]=0
nax=10**9 +7
for i in range(1,n+1):
    if(s[i-1]=='b'):
        last=i-1
        dp[i]=dp[i-1]
    elif(s[i-1]=='a'):
        if(last!=-1):
            dp[i]=(dp[last]%nax + dp[i-1]%nax + 1)%nax
        else:
            dp[i]=(dp[i-1]%nax +1)%nax
    else:
        dp[i]=dp[i-1]
    #print(dp[i])
    
print(dp[n])
            
