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() {
  long long int i, t = 0, subseq = 1;
  string str;
  cin >> str;
  for (i = 0; i < str.size(); i++) {
    if (str[i] == 'a') {
      t++;
    } else if (str[i] == 'b') {
      subseq = (subseq * (1 + t)) % 1000000007;
      t = 0;
    }
  }
  subseq = (subseq * (1 + t)) % 1000000007;
  cout << (subseq - 1 + 1000000007) % 1000000007;
  return 0;
}
