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