aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()

total = 0
numOfA = 0
potentialA = 0

for i in range(len(s)):
    if s[i] == 'a':
        total += 1
        potentialA += 1
    elif i > 0 and s[i] == 'b' and s[i-1] == 'a':
        numOfA += potentialA
        potentialA = 0
    if s[i] == 'a':
        total += numOfA

print(total%1000000007)