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 mod = 1e9 + 7;
const int N = 1e5 + 7;
int f[N];
char s[N];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1), last = 0;
  for (int i = 1; i <= n; i++) {
    f[i] = f[i - 1];
    if (s[i] == 'a')
      f[i] = (f[i] + last + 1) % mod;
    else if (s[i] == 'b')
      last = f[i - 1];
  }
  printf("%d\n", f[n]);
  return 0;
}
