aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define pb(x) push_back(x)
#define vec vector<long long>
#define ll long long
#define fi first
#define se second
#define print(a) for(auto i:a)cout<<i<< " ";cout<<endl
#define mod 1000000007

using namespace std;

int main()
{
  string s;cin>>s;
  vector<char> v;
  rep(i,0,s.size()){
    if(s[i] == 'a' || s[i] == 'b')v.pb(s[i]);
  }
  ll x = v.size();
  ll dp[x] = {0};
  dp[x-1] = 1;
  ll sum = 1;
  repr(i,x-2,0){
    if(v[i] == 'a' && v[i+1] == 'b')dp[i] = (1 + sum%mod)%mod,sum = (sum%mod+dp[i]%mod)%mod;
    else if(v[i] == 'a' && v[i+1] == 'a')dp[i] = dp[i+1],sum = (sum%mod+dp[i]%mod)%mod;
    else dp[i] = dp[i-1]%mod;
  }
  ll ans = 0;
  rep(i,0,x){
    if(v[i] == 'a')ans = (ans%mod + dp[i]%mod)%mod;
  }
  cout<<ans%mod;
}
