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