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 str, s = "";
  cin >> str;
  vector<long> v(1e5 + 5, 0);
  long top = 0;
  for (long i = 0; i < (long)str.length(); i++) {
    if (str[i] == 'a')
      s += str[i];
    else if (str[i] == 'b' && s.length())
      s += str[i];
  }
  bool isb = false;
  for (long i = 0; i < (long)s.length(); i++) {
    if (s[i] == 'a') {
      v[top]++;
      isb = false;
    } else {
      if (isb == false) {
        top++;
        isb = true;
      }
    }
  }
  long prod = 1;
  long mod = long(1e9 + 7);
  for (long i = 0; i <= top; i++) {
    prod = (prod + (prod * (v[i] + 1) % mod) % mod) % mod;
  }
  cout << max((long)0, (prod + mod - 1) % mod) << endl;
}
