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;
const long long mod = 1000000007;
vector<int> V;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  string cad;
  int i;
  long long ans = 1, x;
  cin >> cad;
  V.push_back(0);
  for (i = 0; i < cad.size(); i++) {
    if (cad[i] == 'a')
      V[V.size() - 1]++;
    else if (cad[i] == 'b' && V[V.size() - 1] > 0)
      V.push_back(0);
  }
  for (i = 0; i < V.size(); i++) {
    x = V[i] + 1;
    ans = (ans * x) % mod;
  }
  ans = (mod + ans - 1) % mod;
  cout << ans << '\n';
}
