#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const double EPS = 1e-1;
const double PI = 3.14159265359;
const long long MOD = 1e9 + 7;
const int MAXON = 1e5 + 1;
const int IGOR = 21;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  vector<long long> dp(n, 0), p(n, 0);
  int last = -1;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'a') {
      dp[i] = 1;
      if (last != -1) {
        dp[i] += p[last];
      }
    } else if (s[i] == 'b') {
      last = i;
    }
    if (i)
      p[i] += p[i - 1] + dp[i];
    else
      p[i] = dp[i];
    p[i] %= MOD;
  }
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'a') {
      ans += dp[i];
      ans %= MOD;
    }
  }
  cout << ans;
  return 0;
}
