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