#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int maxM = 1001000;
vector<long long> B(maxM);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int i;
  long long ans = 0;
  string cad;
  cin >> cad;
  B[cad.size() - 1] = 0;
  if (cad[cad.size() - 1] == 'b') B[cad.size() - 1] = 1;
  for (i = cad.size() - 2; i >= 0; i--) {
    B[i] = B[i + 1];
    if (cad[i] == 'b')
      B[i] = (B[i] + 1) % mod;
    else {
      ans = (ans + B[i + 1]) % mod;
      B[i] = (B[i] * 2) % mod;
    }
  }
  cout << ans << '\n';
}
