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 int M = pow(10, 9) + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  long long int c = 0;
  vector<long long int> a;
  for (long long int i = 0; i < s.size(); i++) {
    c += s[i] == 'a';
    if (s[i] == 'b') {
      if (c != 0) a.push_back(c);
      c = 0;
    }
  }
  if (c != 0) a.push_back(c);
  if (a.size() > 0) {
    vector<long long int> dp(a.size() + 1, 0), sum(a.size() + 1, 0);
    dp[0] = 0;
    for (long long int i = 1; i <= a.size(); i++) {
      dp[i] = ((dp[i - 1] + 1) * a[i - 1]) % M;
    }
    for (long long int i = a.size() - 1; i >= 0; i--) {
      sum[i] = (sum[i + 1] + a[i]) % M;
    }
    long long int ans = 0;
    for (long long int i = 0; i <= a.size(); i++) {
      if (i == 0) {
        ans = (ans + sum[i]) % M;
      } else {
        ans = (ans + ((dp[i] * sum[i]) % M)) % M;
      }
    }
    cout << ans << endl;
  } else
    cout << 0 << endl;
}
