#include <bits/stdc++.h>
using namespace std;
#define NMAX 100009
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
typedef long long int i64;
const int mod = 1000000007 ;
int main(void)
{
//freopen("in.txt","r",stdin);
string inp ;
cin>>inp ;
int n = inp.size() , i ;
char arr[n] ;
for(i=0;i<n;i++){
arr[i] = inp[n-i-1] ;
}
i64 no_b = 0 , ans = 0 ;
for(i=0;i<n;i++){
if(arr[i]=='a'){
ans = (ans%mod + no_b%mod)%mod ;
no_b += no_b ;
ans %= mod ;
}
else{
no_b++ ;
}
}
cout<<ans<<endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIE5NQVggCQkxMDAwMDkKI2RlZmluZSBERUJVRyh4KSAJY291dCA8PCAnPicgPDwgI3ggPDwgJzonIDw8IHggPDwgZW5kbDsKCnR5cGVkZWYgbG9uZyBsb25nIGludCBpNjQ7CmNvbnN0IGludCBtb2QgPSAxMDAwMDAwMDA3IDsKCmludCBtYWluKHZvaWQpCnsKCS8vZnJlb3BlbigiaW4udHh0IiwiciIsc3RkaW4pOwoJc3RyaW5nIGlucCA7CgljaW4+PmlucCA7CglpbnQgbiA9IGlucC5zaXplKCkgLCBpIDsKCWNoYXIgYXJyW25dIDsKCWZvcihpPTA7aTxuO2krKyl7CiAgICAgICAgYXJyW2ldID0gaW5wW24taS0xXSA7Cgl9CglpNjQgbm9fYiA9IDAgLCBhbnMgPSAwIDsKCWZvcihpPTA7aTxuO2krKyl7CiAgICAgICAgaWYoYXJyW2ldPT0nYScpewogICAgICAgICAgICBhbnMgPSAoYW5zJW1vZCArIG5vX2IlbW9kKSVtb2QgOwogICAgICAgICAgICBub19iICs9IG5vX2IgOwogICAgICAgICAgICBhbnMgJT0gbW9kIDsKICAgICAgICB9CiAgICAgICAgZWxzZXsKICAgICAgICAgICAgbm9fYisrIDsKICAgICAgICB9Cgl9Cgljb3V0PDxhbnM8PGVuZGw7CglyZXR1cm4gMDsKfQo=