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;
template <typename T>
void printVector(const T& t) {
  if (t.size() > 0)
    cout << t[0];
  else {
    cout << "\n";
    return;
  }
  for (int i = int(1); i < int(t.size()); i++) {
    cout << " " << t[i];
  }
  cout << "\n";
}
using ll = long long;
const int mode = 0;
const ll mod = 1e9 + 7;
void solve() {
  string s;
  cin >> s;
  s += "b";
  vector<int> as;
  int curr = 0;
  for (char c : s) {
    if (c == 'a') {
      curr++;
    } else if (c == 'b') {
      if (curr > 0) as.push_back(curr);
      curr = 0;
    }
  }
  ll ans = 1LL;
  for (int a : as) {
    ans = (ans * (ll)(a + 1)) % mod;
  }
  ans = (ans - 1 + mod) % mod;
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  if (mode == 0) {
    solve();
  } else {
    cin >> t;
    while (t--) {
      solve();
    }
  }
}
