aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
n = len(s)
arr = []
start = 0
end = 0
for i in range(n):
    if s[i] != 'b':
        end = i
    else:
        if start <= end:
            arr.append(s[start:end+1])
        start = i+1
        end = i
if start <= end:
    arr.append(s[start:end+1])

t = 0
counts = [x.count('a') for x in arr]
if len(arr) == 0:
    print(0)
else:
    m = len(arr)
    for i in range(m):
        t = ((t + counts[i])%1000000007 + ((t*counts[i])%1000000007))%1000000007
    print(t)


