#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long power(long long a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  if (b % 2 == 1) return (power(a, b - 1) * a) % 1000000007;
  long long q = power(a, b / 2);
  return (q * q) % 1000000007;
}
void solve() {
  string s;
  cin >> s;
  long long val = 0;
  long long c = 0;
  long long fact[100005], ifact[100005];
  fact[0] = ifact[0] = 1;
  for (int i = 1; i < 100005; i++) {
    fact[i] = fact[i - 1] * i % 1000000007;
    ifact[i] = power(fact[i], 1000000007 - 2);
  }
  vector<long long> ans;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'b') {
      if (c) ans.push_back(c);
      c = 0;
    }
    if (s[i] == 'a') c++;
  }
  if (c > 0) ans.push_back(c);
  long long l = ans.size();
  if (l == 0) {
    cout << "0\n";
    return;
  }
  val += ans[l - 1];
  for (int i = l - 2; i >= 0; i--) {
    val += val * ans[i] + ans[i];
    val %= 1000000007;
  }
  cout << val << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  while (tc--) solve();
  return 0;
}
