aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import sys
input = sys.stdin.readline

rs = input()
s = ''
flag = False
for x in rs:
    if x == 'b':
        if not flag:
            flag = True
            s += x
    elif x == 'a':
        s += x
        flag = False

# print(s)
cnt = 0; ans = 1
mod = int(10**9)+7
for x in s:
    if x == 'a':
        cnt += 1
    elif x == 'b':
        ans = (ans*(cnt+1))%mod
        cnt = 0

if cnt>0: ans = (ans*(cnt+1))%mod
ans = (ans-1+mod)%mod
print(ans)        