#include <bits/stdc++.h>
using namespace std;
int N;
string inp;
long long mod = 1000000007;
int main() {
  cin >> inp;
  N = inp.length();
  long long out = 0;
  long long at = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (inp[i] == 'b')
      at++;
    else {
      out += at;
      at *= 2;
    }
    out %= mod;
    at %= mod;
  }
  cout << out << endl;
}
