aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
l = []
temp = ""
for i in s:
    if (i == 'a' or i == 'b'):
        temp+=i
    else:
        l.append(temp)
        temp = ""
l.append(temp)

ans = 0
mod = 1000000007
for ss in l:
    ls = ss.split('b')
    lengs = []
    while(ls.count("") != 0):
        ls.remove("")
    
    for a in ls:
        lengs.append(len(a))
        ans = (ans%mod + len(a)%mod)%mod

    

    leng = len(lengs)

    if(leng!=0):
        i = leng-1
        prod = lengs[i]
        i-=1
        while(i >= 0):
            if(lengs[i]!=0):
                prod = ((prod%mod)* (lengs[i])%mod)%mod
                ans = (ans%mod + prod%mod)%mod
            i-=1


print(ans)
    
    
