#include <bits/stdc++.h>
long long mod = (long long)1e9 + 7;
;
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.size();
  long long sum = 0, sun = 0;
  for (int i = l - 1; i >= 0; i--) {
    if (s[i] == 'b')
      sum++;
    else {
      sun += sum % mod;
      sun %= mod;
      sum *= 2;
      sum %= mod;
    }
  }
  cout << sun % mod << endl;
}
