#include <bits/stdc++.h>
const int N = 1e9 + 7;
using namespace std;
int main() {
  string s;
  long long int i;
  while (cin >> s) {
    long long int t = 0;
    long long int ans = 0;
    long long int l = s.length();
    for (i = l - 1; i >= 0; i--) {
      if (s[i] == 'b')
        t = (t + 1) % N;
      else {
        ans = (ans + t) % N;
        t = (t * 2) % N;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
