aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
long long K = 1e9 + 7;
using namespace std;
int main() {
  string s;
  cin >> s;
  long long n = int(s.size());
  long long ans = 1;
  long long am = 0;
  for (long long i = 0; i < n; ++i) {
    if (s[i] == 'a') ++am;
    if ((s[i] == 'b' || i == n - 1) && am) {
      ans *= (am + 1);
      ans %= K;
      am = 0;
    }
  }
  cout << ans - 1;
}
