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;
int main() {
  char data[100100];
  long long ans = 0;
  scanf("%s", data);
  int l = strlen(data);
  int add = 0, all = 0, flag = 0;
  for (int i = 0; i < l; i++) {
    if (data[i] == 'a') {
      if (i != 0 && data[i - 1] == 'a')
        all++;
      else
        all = 1;
      if (flag == 1) ans += add - all + 1;
      ans++;
      add++;
    } else if (data[i] == 'b') {
      flag = 1;
    } else {
      add = 0;
      flag = 0;
    }
    ans %= 1000000007;
  }
  printf("%I64d", ans);
  return 0;
}
