#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int HMOD = 999959;
const int VMOD = 5000000;
const int MAXN = 1e5 + 10;
const int INV = 500000004;
const double eps = 1e-8;
int Next[4][2] = {-1, 0, 0, 1, 1, 0, 0, -1};
int n;
char s[MAXN];
long long dp[MAXN];
vector<int> vec;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  scanf("%s", s);
  n = strlen(s);
  int tmp = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') tmp++;
    if (s[i] == 'b' && tmp > 0) {
      vec.push_back(tmp);
      tmp = 0;
    }
  }
  if (tmp > 0) vec.push_back(tmp);
  dp[0] = 0;
  for (int i = 0; i < (int)vec.size(); i++) {
    int x = i + 1;
    dp[x] = (vec[i] + dp[i] * (vec[i] + 1) % MOD) % MOD;
  }
  printf("%lld\n", dp[(int)vec.size()]);
  return 0;
}
