aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
ln = len(s)
cnt = [0 for i in range(ln)]
ans, mod, prev_b = 0, 10 ** 9 + 7, -1
for i in range(ln):
    if s[i] == 'a':
        ans += 1
        if prev_b > -1:
            ans += cnt[prev_b]
        ans %= mod
    if s[i] == 'b':
        cnt[i] = ans % mod
        prev_b = i
print(ans % mod)
