aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

m = 10**(9)+7
s = input()
n = len(s)
a = 0
b = 0
k = 0
table = [0]*(n+1)
dp = [0]*(n+1)
for i in range(n):
    if s[i] == 'a':
        a = a+1
        table[b] = table[b] +1
        c = b
    elif s[i] == 'b':
        b = b+1
    else:
        k = k+1
if k == n:
    print(0)
else:
    dp[c] = table[c]
    prev = c
    su = table[c]
    for i in range(c-1,-1,-1):
        if table[i] != 0:
            dp[i] = ((table[i]%m)*(dp[prev]%m))%m
            su = (su%m+table[i]%m)%m
            prev = i
    if prev != c:
        print((dp[prev]%m+su%m)%m)
    else:
        print(dp[c])