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 modulo = 1000000007;
long long mod(long long n) { return ((n % modulo) + modulo) % modulo; }
int main() {
  string inputString;
  cin >> inputString;
  long long answer = 1;
  long long possibilitiesPerGroupOfAs = 1;
  for (int i = 0; i < inputString.length(); ++i) {
    if (inputString[i] == 'a')
      possibilitiesPerGroupOfAs += 1;
    else if (inputString[i] == 'b') {
      answer = mod(answer * possibilitiesPerGroupOfAs);
      possibilitiesPerGroupOfAs = 1;
    }
  }
  answer = mod(mod(answer * possibilitiesPerGroupOfAs) - 1);
  cout << answer << endl;
  return 0;
}
