aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
char str[100005];
int main() {
  scanf("%s", str + 1);
  int i, n = strlen(str + 1);
  int act = 0, inact = 0;
  long long ans = 0;
  for (i = 1; i <= n; i++) {
    if (str[i] == 'a') {
      ans += act;
      ans %= 1000000007;
      ans++;
      ans %= 1000000007;
      inact++;
    }
    if (str[i] == 'b') {
      act += inact;
      inact = 0;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
