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 long long inf = 1e9 + 7;
char s[100010];
long long num[100010];
long long ans = 1;
int sum = 0;
int main() {
  scanf("%s", s);
  for (int i = 0; s[i] != '\0'; i++) {
    if (s[i] == 'a') num[sum]++;
    if (s[i] == 'b' && num[sum]) sum++;
  }
  for (int i = 0; i <= sum; i++)
    if (num[i]) ans = ans * (num[i] + 1) % inf;
  printf("%lld", ans - 1);
  return 0;
}
