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 in;
  cin >> in;
  unsigned long long int s = 1;
  unsigned long long int cant = 0;
  unsigned long long int curr = 0;
  unsigned long long int mod = 1000000007;
  int a = 0;
  int i = -1;
  while (++i < in.size() && in[i] != 'a')
    ;
  if (i == in.size()) {
    cout << 0 << '\n';
    return 0;
  }
  cant = 1;
  int lst = 'a';
  for (; i < in.size(); i++) {
    if (lst == 'b') {
      if (in[i] == 'a') {
        curr = 1;
        cant++;
        lst = 'a';
      }
    } else {
      if (in[i] == 'a') {
        curr++;
      }
      if (in[i] == 'b') {
        lst = 'b';
        s *= (curr + 1);
        curr = 0;
        s %= mod;
      }
    }
  }
  if (curr) s *= (curr + 1);
  s %= mod;
  s--;
  s %= mod;
  cout << s << '\n';
}
