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;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 10;
const ll INFL = 9e18;
const ld eps = 1e-8;
const ld Pi = acosl(-1.0);
void solve();
int main() {
  cout.precision(9);
  cout << fixed;
  int t = 1;
  while (t--) solve();
}
int add(int a, int b) {
  return ((a + b) % MOD + MOD) % MOD;
  ;
}
int mlp(int a, int b) { return (1ll * a * b) % MOD; }
void solve() {
  string s;
  cin >> s;
  int ans = 1;
  int n = s.size();
  int cnt = 0;
  for (int i = 0; i < int(n); i++) {
    cnt += s[i] == 'a';
    if (s[i] == 'b') {
      ans = mlp(ans, cnt + 1);
      cnt = 0;
    }
  }
  ans = mlp(ans, cnt + 1);
  cout << add(ans, -1) << '\n';
}
