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