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;
long long ft[100005], la[100005], ra[100005], sum[100005], ans, temp;
long long fact(long long n) {
  long long mul = 1;
  if (n == 0) return ft[0] = 1;
  for (long long i = n; i > 0; i--) {
    if (ft[i] != -1)
      return ft[n] = ((mul % 1000000007) * (ft[i] % 1000000007) % 1000000007);
    else
      mul = ((mul % 1000000007) * (i % 1000000007) % 1000000007);
  }
}
int main() {
  string str;
  cin >> str;
  int j = 0, na = 0, k = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == 'a') na++, k++;
    if (str[i] == 'b') {
      if (j == 0) {
        la[j] = na;
        sum[j] = na;
      } else {
        la[j] = ra[j - 1] = na;
        sum[j] = sum[j - 1] + na;
      }
      na = 0;
      j++;
    }
  }
  ra[j - 1] = na;
  ans = k;
  memset(ft, -1, sizeof ft);
  for (int i = 0; i < j; i++) {
    if (ra[i] == 0)
      temp = 0;
    else
      temp = fact(ra[i]);
    ans = (ans % 1000000007 +
           ((sum[i] % 1000000007) * (temp % 1000000007) % 1000000007) %
               1000000007) %
          1000000007;
  }
  cout << ans;
}
