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)
ans = [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]
    ans[c] = table[c]
    prev = c
    for i in range(c-1,-1,-1):
        if table[i] != 0:
            dp[i] = ((ans[prev]%m)*(table[i]%m)+table[i]%m)%m
            ans[i] = (dp[i]%m+ans[prev]%m)%m
            prev = i
    if prev == c:
        print(dp[prev])
    else:
        res = 0
        for i in range(n+1):
            res = (res+(dp[i]%m))%m
        print(res)