#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
const int M = 1000000007;
const double PI = atan(1) * 4;
const int oo = 1000000000;
char s[10 * N];
int dp[10 * N];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  while (n && s[n - 1] == 'a') --n;
  long long ans = 0;
  for (int i = n - 1; i >= 0; --i) {
    dp[i] = dp[i + 1];
    if (s[i] == 'a') ans += dp[i];
    if (s[i] == 'b')
      dp[i] = (dp[i] + 1) % M;
    else
      dp[i] = (dp[i] * 2) % M;
  }
  cout << ans % M << endl;
}
