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 str;
  cin >> str;
  long long count = 0, ans = 1;
  vector<long long> v;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == 'a') {
      count++;
    } else if (str[i] == 'b') {
      v.push_back(count);
      count = 0;
    }
  }
  v.push_back(count);
  vector<long long>::iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    ans *= ((*it) + 1) % 1000000007;
  }
  cout << ans - 1 << endl;
}
