aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

line = list(input()) + ['b']
a = []
count = 0
for i in line:
    if i == 'b' and count > 0:
        a.append(count)
        count = 0
    if i == 'a':
        count += 1
dp = []
for i in range(1, len(a) + 1):
    cur = 1
    ans = 0
    for pos in range(i):
        cur *= a[pos]
    ans += cur
    for pos in range(len(a) - i):
        cur //= a[pos]
        cur *= a[pos + i]
        ans += cur
    ans %= 1000000007
    dp.append(ans)
ans = 0
for i in dp:
    ans += i
    ans %= 1000000007
print(ans)
