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;
long long int mod = 1000000007;
int main() {
  long long int n, i, j, k, sum, l;
  string s, p;
  cin >> s;
  l = s.length();
  sum = 1;
  k = 0;
  for (i = 0; i < l; i++) {
    if (s[i] == 'a') {
      k++;
    } else if (s[i] == 'b') {
      k++;
      sum = (sum * k) % mod;
      k = 0;
    }
  }
  if (k != 0) {
    k++;
    sum = (sum * k) % mod;
  }
  cout << sum - 1 << endl;
  return 0;
}
