aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
void IO(bool inp, bool out) {
  if (inp) freopen("k.inp", "r", stdin);
  if (out) freopen("k.out", "w", stdout);
}
using namespace std;
char s[100010];
long long op[100010], kq;
int n;
int main() {
  IO(0, 0);
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int u = -1, v = -1;
  for (int i = 1; i <= n; ++i)
    if (s[i] == 'b') {
      if (v > 0) u = v, v = -1;
    } else if (s[i] == 'a') {
      op[i] = 1;
      if (u > -1) op[i] += op[u];
      if (op[i] >= 1000000007ll) op[i] %= 1000000007ll;
      kq += op[i];
      if (kq >= 1000000007ll) kq %= 1000000007ll;
      v = i;
    }
  printf("%I64d", kq);
}
