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 = 1000000000 + 7;
string s;
int p[100005];
int main() {
  cin >> s;
  long long ans = 1;
  int k = 0, l = 1;
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == 'a') ++l;
    if (s[i] == 'b') {
      if (l == 1) continue;
      p[++k] = l % MOD;
      l = 1;
    }
  }
  p[++k] = l;
  for (int i = 1; i <= k; ++i) ans = ans * p[i] % MOD;
  --ans;
  printf("%lld\n", ans);
  return 0;
}
