aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
char s[100002];
int pos[100002], x[100002], f[100002];
int main() {
  scanf("%s", s + 1);
  int slen = strlen(s + 1);
  for (int i = 1; i <= slen; i++) pos[i] = i;
  int count = 0, ct = 0;
  for (int idx = 1; idx <= slen; idx++) {
    if (s[idx] == 'a') {
      ct++;
    } else if (s[idx] == 'b' && ct > 0) {
      x[++count] = ct;
      ct = 0;
    }
  }
  if (ct > 0) x[++count] = ct;
  f[1] = x[1];
  for (int i = 2; i <= count; i++)
    f[i] = (x[i] + (long long)(1 + x[i]) * f[i - 1]) % 1000000007;
  printf("%d\n", f[count]);
  return 0;
}
