#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool flag = false;
  long long tot = 0;
  long long b = 0;
  for (long long i = (long long)s.length() - 1; i >= 0; i--) {
    if (s[i] == 'b') {
      flag = true;
      b++;
    } else {
      if (flag) {
        tot = (tot % 1000000007 + b % 1000000007) % 1000000007;
        b = (b % 1000000007 * 2) % 1000000007;
      }
    }
  }
  printf("%lld\n", tot);
}
