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;
const long long MOD = 1e9 + 7;
char s[100005];
int n;
long long total_mod = 1, to_add;
int main() {
  bool ok = false;
  cin >> (s + 1);
  for (int i = 1; s[i]; ++i)
    if (s[i] == 'b' && ok || s[i] == 'a') ok = true, s[++n] = s[i];
  s[n + 1] = 0;
  for (int i = 1; s[i]; ++i) {
    if (s[i] == 'a')
      ++to_add;
    else
      total_mod = (total_mod * (to_add + 1)) % MOD, to_add = 0;
  }
  total_mod = (total_mod * (to_add + 1) + MOD - 1) % MOD;
  cout << total_mod;
  return 0;
}
