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;
vector<int> noprimes(1000001);
void seive(vector<int> &primes, int n) {
  vector<bool> ntprimes(n + 1, false);
  ntprimes[0] = ntprimes[1] = true;
  for (int i = 2; i * i <= n; i++) {
    if (!ntprimes[i]) {
      for (int j = i * i; j <= n; j += i) {
        ntprimes[j] = true;
      }
    }
  }
  int x = 0;
  for (int i = 2; i <= n; i++) {
    if (!ntprimes[i]) {
      primes.push_back(i);
      x++;
      noprimes[i] = x;
    } else
      noprimes[i] = x;
  }
}
long long pow(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n % 2 == 0) {
      n = n / 2;
      x = x * x;
    } else {
      res *= x;
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int count = 0;
  vector<int> A;
  int sum = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a')
      count++;
    else if (s[i] == 'b') {
      if (count) {
        sum += count;
        A.push_back(count);
        count = 0;
      }
    }
  }
  if (count) {
    sum += count;
    A.push_back(count);
  }
  vector<int> dp(A.size());
  if (A.size() > 0) dp[0] = A[0];
  for (int i = 1; i < A.size(); i++) {
    dp[i] = (dp[i - 1] % 1000000007 +
             (A[i] % 1000000007 * dp[i - 1] % 1000000007) % 1000000007 +
             A[i] % 1000000007) %
            1000000007;
  }
  if (dp.size() > 0)
    cout << dp[A.size() - 1];
  else
    cout << 0;
  return 0;
}
