#include <bits/stdc++.h>
using namespace std;
long long mian() {
  long long s = 0, f = 1;
  char ch;
  while (!isdigit(ch = getchar())) (ch == '-') && (f = -1);
  for (s = ch - '0'; isdigit(ch = getchar()); s = s * 10 + ch - '0')
    ;
  return s * f;
}
const long long maxn = 1e5 + 5;
const long long p = 1e9 + 7;
char s[maxn], c[maxn];
long long num[maxn], sum[maxn], tmp[maxn];
signed main() {
  scanf("%s", c);
  long long len = strlen(c);
  long long n = 1;
  for (long long i = 0; i < len; ++i)
    if (c[i] == 'a')
      num[n]++;
    else if (c[i] == 'b' && num[n] != 0)
      n++;
  for (long long i = 1; i <= n; ++i)
    sum[i] = (sum[i - 1] * num[i] + num[i] % p + sum[i - 1]) % p;
  cout << sum[n] << endl;
  return 0;
}
