#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> s;
  long long ans = 0, sumi = 0, i;
  for (i = s.length() - 1; i >= 0; i--) {
    if (s[i] == 'b') {
      sumi++;
    } else {
      ans += sumi;
      ans %= (1000 * 1000 * 1000 + 7);
      sumi *= 2;
      sumi %= (1000 * 1000 * 1000 + 7);
    }
  }
  cout << ans << endl;
}
