aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

def power(a, b, mod):
    res = 1
    
    while b:
        if b%2:
            res = (res*a)%mod
        
        b //= 2
        a = (a*a)%mod    
            
    return res%mod

s = input()
n = len(s)
MOD = 10**9+7
bckt = []
ct = 0

for i in range(n):
    if s[i] == "a":
        ct += 1
    elif s[i] == "b" and ct:
        bckt.append(ct)
        ct = 0
        
if ct:
    bckt.append(ct)
    
prod = (power(2, len(bckt), MOD)-len(bckt)-1)%MOD
for i in bckt:
    prod = (prod*i)%MOD

print((prod+s.count("a"))%MOD)