aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
mod = 10**9 + 7
L = []
c = 0
f = 0
for i in s:
    if i == 'a':
        f = 0
        c += 1
    elif i == 'b' and f == 0:
        L.append(c)
        c = 0
        f = 1
if c > 0 and f == 0:
    L.append(c)
res = 1
for i in range(len(L)):
    res *= (L[i]+1)%mod
print((res-1)%mod)