aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import sys
input = sys.stdin.readline
from collections import *
from bisect import *

class BIT:
    #n:要素数
    def __init__(self, n):
        self.n = n
        self.bit = [0]*(n+1)
    
    #i番目(0-indexed)の値にxを足す
    def add(self, i, x):
        i += 1
        
        while i<=self.n:
            self.bit[i] += x
            self.bit[i] %= MOD
            i += i&(-i)
    
    #0からi番目までの値の和を求める
    def acc(self, i):
        i += 1
        s = 0
        
        while i>0:
            s += self.bit[i]
            s %= MOD
            i -= i&(-i)
        
        return s

s = input()[:-1]
n = len(s)
b = []

for i in range(n):
    if s[i]=='b':
        b.append(i)

bit = BIT(n)
MOD = 10**9+7

for i in range(n):
    if s[i]=='a':
        idx = bisect_left(b, i)-1
        
        if idx==-1:
            bit.add(i, 1)
        else:
            bit.add(i, 1+bit.acc(b[idx]-1))

print(bit.acc(n-1)%MOD)
