aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

M = 1000000007
S = input()
flag = False
count = 0
List =[]
for i in range(len(S)):
    if(S[i] == "b" and flag and count):
        List.append(count)
        count = 0
    elif(S[i] == "a"):
        count += 1
        flag = True
if(flag):
    List.append(count)
if(not List):
    print(0)
    exit()


N = len(List)
dp = [0] * N
dp[0] = List[0]
for i in range(1,N):
    dp[i] = dp[i-1] + List[i] + dp[i-1] * List[i]
    dp[i] %= M
print(dp[-1])


