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;
int32_t main() {
  string s;
  cin >> s;
  long long n = s.size();
  vector<long long> points;
  long long i = 0;
  long long k = 0;
  while (i < n) {
    if (s[i] == 'a') {
      k++;
    }
    if (s[i] == 'b') {
      points.push_back(k + 1);
      k = 0;
    }
    i++;
  }
  if (k > 0) {
    points.push_back(k + 1);
  }
  long long ans = 1;
  for (long long i = 0; i < points.size(); i++) {
    ans = (ans % 1000000007 * points[i] % 1000000007) % 1000000007;
  }
  ans--;
  cout << ans << "\n";
}
