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 t, n, N, p, q, r, c, R, C, m, mx = 0, tt, height, width;
long long ans, s, ss, mn = 1e12, sss;
bool check = false;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  int count_a = 0;
  string str;
  cin >> str;
  vector<int> sol;
  for (char x : str) {
    if (x == 'a') count_a++;
    if (x == 'b') sol.push_back(count_a), count_a = 0, check = true;
  }
  if (str.back() != 'b') sol.push_back(count_a);
  if (sol.size()) {
    ans = 1;
    for (int x : sol) {
      ans = ((ans % 10000000009) * (x % 10000000009)) % 10000000009;
    }
    cout << ans - 1 << endl;
  } else
    cout << 0 << endl;
  return 0;
}
