aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import sys
# import heapq
from math import ceil,floor



RI = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
mod = 10**9+7
# for _ in range(int(ri())):
st = ri()

a = []
cnt = 0
for i in st:
    if i == 'a':
        cnt+=1
    if i == 'b':
        if cnt!= 0:
            a.append(cnt)
            cnt=0
a.append(cnt)
dp = [0]*len(a)
# print(a)
dp[0] = a[0]
ans = a[0]
for i in range(1,len(a)):
    dp[i] = ((dp[i-1]*a[i])%mod + a[i])%mod
    ans= (ans+dp[i])%mod

print(ans)
