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