#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int INF = 1e9;
const double EPS = 1e-8;
int main() {
  string a;
  cin >> a;
  int len = a.size();
  long long temp = 0;
  long long ans = 0;
  for (int i = len - 1; i >= 0; i--) {
    if (a[i] == 'a') {
      ans = (ans + temp) % mod;
      temp = (temp * 2) % mod;
    } else {
      temp++;
    }
  }
  cout << ans << endl;
}
