aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s1 = input()
s = ''
for el in s1:
    if el == 'b':
        if len(s) > 0 and s[-1] != 'b':
            s += el
    elif el == 'a':
        s += el
s += 'b'        
arr = []
block = 0
for i in range(len(s)):
    if s[i] == 'a':
        block += 1
    if s[i] == 'b':
        if block > 0:
            arr.append(block)
            block = 0
ans = 1
for el in arr:
    ans *= (el + 1)
print((ans - 1) % (1000000000 + 7))