aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

a = input()
n = len(a)
mod = int(1e9+7)
s = 0
ans = 0
bfound  = True
for i in range(n-1,-1,-1):
    if a[i] =='b':
        bfound = True
    elif a[i] =='a':
        if bfound:
            bfound = False
            ans+=s+1
            last = s+1
            s+=s+1
        else:
            s+=last
            ans+=last
    s%=mod
    ans%=mod
print(ans)

