aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from sys import stdin,stdout
from itertools import combinations
from collections import defaultdict,OrderedDict
import math

def listIn():
    return list((map(int,stdin.readline().strip().split())))

def stringListIn():
    return([x for x in stdin.readline().split()])
    
def intIn():
    return (int(stdin.readline()))

def stringIn():
    return (stdin.readline().strip())


def solve(st):
    bcnt=st.count('b')
    if bcnt==0:
        return st.count('a')
    
    block=[]
    cnt=0
    for i in range(len(st)):
        if st[i]=='a':
            cnt+=1
        else:
            if st[i]=='b':
                if i!=0 and cnt>0:
                    block.append(cnt)
                    cnt=0
    if st[-1]!='b':
        block.append(cnt)
    
    ans=1
    for bl in block:
        ans*=(bl+1)%MOD
    
    return (ans-1)%MOD
    
    
    
if __name__=="__main__":
    MOD=10**9+7
    s=stringIn()
    ans=solve(s)
    print(ans)
    
    
    
    
    
    
    