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(void) {
  string s, s1;
  cin >> s;
  long long m = 1e+7;
  long long int n = s.length();
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a' || s[i] == 'b') s1 += s[i];
  }
  for (int i = 0; i < s1.length(); i++) {
    if (s1[i] == s1[i + 1] && s1[i] == 'b') {
      s1.erase(i, 1);
      i--;
    }
  }
  long long int ans = 0, c = 0;
  for (int i = s1.length() - 1; i > -1; i--) {
    c = 0;
    if (s1[i] == 'a') {
      while (s1[i] == 'a') {
        c++;
        i--;
        if (c >= m) c -= m;
      }
      ans = (ans + ((ans + 1) * c) % m) % m;
    }
  }
  cout << ans;
}
