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() {
  string s;
  cin >> s;
  long long int a = 0, ans = 1, i;
  vector<int> v;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == 'b') {
      if (a != 0) v.push_back(a);
      a = 0;
    } else if (s[i] == 'a') {
      a++;
    }
  }
  if (a != 0) v.push_back(a);
  for (i = 0; i < v.size(); i++) {
    ans *= (v.at(i) + 1);
  }
  long long int mod;
  mod = pow(10, 9) + 5;
  cout << (ans - 1) % mod;
  return 0;
}
