aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import sys

s = sys.stdin.readline().strip()
l = len(s)
result = 1
a = 0

for i in range (0, l):
    if s[i] == 'a':
        a = a + 1
    elif s[i] == 'b':
        result = (result * (a + 1)) % (10 ** 9 + 7)
        a = 0
result = (result * (a + 1)) % (10 ** 9 + 7)
print(result - 1)
