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;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string second;
  cin >> second;
  long long int ans = 1, ctr = 0, acount = 0, bcount = 0;
  vector<int> v;
  for (int i = 0; second[i]; i++) {
    if (second[i] == 'b') {
      bcount++;
      if (acount == 0) continue;
      ctr++;
      ans *= (1 + acount);
      acount = 0;
    }
    if (second[i] == 'a') acount++;
    if (i == second.size() - 1) {
      ctr++;
      ans *= (acount + 1);
    }
  }
  ans--;
  cout << ans % int(1e9 + 7) << "\n";
  return 0;
}
