aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define ll long long
#define M 1000000007
int main()
{
    ios_base::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    string str;
    ll prod=1;
    int count=0;
    cin>>str;
    rep(i,0,str.length())
        if(str[i]=='b')
            count++;
    int j=0;
    int n[count+1]={0};
    rep(i,0,str.length()){
        if(str[i]=='a')
            n[j]++;
        if(str[i]=='b')
            j++; }
    for(int i=0;i<count+1;++i)
            prod*=n[i]+1;
    prod=prod-1;
    cout<<prod%M;
    return 0;
}