aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import sys
readline = sys.stdin.readline
mod = 10**9+7

L = []
for s in readline().strip():
    if s == 'a':
        L.append(1)
    elif s == 'b' and L and L[-1] != 0:
        L.append(0)

N = len(L)

dp1 = [0]*N
enda = 0
endb = 1
for s in L:
    if s == 0:
        endb = (endb + enda)%mod
    else:
        enda = (enda + endb)%mod
print(enda)

