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 int MAXN = 1e5 + 5;
const int MOD = 1e9 + 7.5;
char s[MAXN];
int f[MAXN], n;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int preb = 0;
  for (int i = 1; i <= n; ++i) {
    f[i] = f[i - 1];
    if (s[i] == 'a') {
      f[i] = (f[i] + f[preb] + 1) % MOD;
    } else if (s[i] == 'b') {
      preb = i;
    }
  }
  cout << f[n] << endl;
  return 0;
}
