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;
  vector<long long> cnt(s.size(), 0);
  long long cur = 0, bs = 0, aa = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == 'a') {
      if (bs) {
        bs = 0, cur++;
        cnt[cur]++;
      } else {
        cnt[cur]++;
      }
      aa++;
    } else if (s[i] == 'b') {
      bs++;
    }
  long long tot = 1;
  for (int i = 0; i <= cur; i++) tot = (tot * (cnt[i] + 1)) % 1000000007;
  tot = (tot - 1) % 1000000007;
  cout << tot << endl;
  return 0;
}
