aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#compute # of a before index i
#compute consecutve # of a before i
#dp[i] = n[i] - c[i] * dp[i-1]
import sys
input = sys.stdin.readline
mod = 10**9+7
s = [i for i in input().strip() if i == 'a' or i == 'b']
n = len(s)
dp = [0 for i in range(n)]
num_a = [0 for i in range(n)]
con_a = [0 for i in range(n)]
cnt = 0
if n == 0:
    print(0)
else:
    
    if s[0] == 'a':
        num_a[0] = 1
        cnt = 1
        dp[0] = 1

    for i in range(1,n):
        if s[i] == 'a':
            num_a[i] = num_a[i - 1] + 1
            con_a[i] = cnt
            cnt += 1
            
        else:
            num_a[i] = num_a[i - 1]
            con_a[i] = cnt
            cnt = 0


    for i in range(1,n):
        if s[i] == 'a':
            dp[i] = dp[i-1] + pow(2,num_a[i] - con_a[i] - 1,mod)
        else:
            dp[i] = dp[i-1]

    print(dp[n - 1] % mod)
