aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

M = 10**9+7
s = input()
l = []
i = 0
while i < len(s):
    if s[i] == "a":
        break

    i += 1

j = len(s)-1
while j > -1:
    if s[j] == "a":
        break

    j -= 1

while i <= j:
    if s[i] == "a":
        l.append(s[i])

    if l[-1] != "b" and s[i] == "b":
        l.append("b")

    i += 1

la = []
ca = 0
for i in l:
    if i == "a":
        ca += 1

    else:
        la.append(ca)

ta = l.count("a")
ans = ta%M
for i in la:
    cnt = (i*(ta-i))%M
    ans = (ans+cnt)%M

print(ans)