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 s;
  cin >> s;
  long long n, i, j, k, sol;
  vector<long long> a;
  vector<long long> b;
  n = s.length();
  for (i = 0; i < n; i++) {
    if (s[i] == 'a') a.push_back(i);
    if (s[i] == 'b') b.push_back(i);
  }
  if (b.empty()) {
    cout << a.size() << endl;
    return 0;
  }
  long long count = 1, m;
  n = a.size();
  m = b.size();
  j = 0;
  bool bexist = true;
  long long t = 0;
  for (i = 0; i < n; i++) {
    j = i + 1;
    while (j < n && a[j] == a[j - 1] + 1) {
      j++;
    }
    t++;
    count = (count * (j - i + 1)) % 1000000007;
    i = j - 1;
  }
  cout << count - 1 << endl;
}
