aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input().strip()
l = len(s)
hsh = [0 for i in range(l)]
mod = 10 ** 9 + 7
cur, mx = 0,0
for i in range(l):
    if s[i] == 'a':
        hsh[i] = cur + 1
        cur += 1
        mx = max(mx, hsh[i])
    elif s[i] == 'b':
        hsh[i] = 'b'
    else:
        hsh[i] = '#'

lft, r = 0, 0
flag = 0
idx = [0 for i in range(l)]
f = 0
while(r < l):
    if hsh[r] != 'b' and hsh[r] != '#' and f != 1:
        f = 1
        lft = r
    if hsh[r] == 'b' and f == 1:
        flag = 1
        
    if flag == 1 and hsh[r] != 'b' and hsh[r] != '#':
        idx[lft] = hsh[r]
        flag = 0
        lft = r
    r += 1

#print(idx)
sm = mx
for i in range(l):
    if idx[i] != 0 and hsh[i] != 'b' and hsh[i] != '#':
        sm += ((idx[i] - hsh[i])* (mx - idx[i] + 1))
        
##print('idx', idx)
##print('hsh', hsh)
print(sm % mod)
