#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
struct _ {
  _() {
    cout.precision(30);
    ios_base::sync_with_stdio(0);
  }
} __;
const int MOD = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int result = 0;
  for (int i = n - 1, b = 0;; i--) {
    for (; i >= 0 && s[i] == 'b'; i--) {
      b = (b + 1) % MOD;
    }
    if (i < 0) break;
    result = (result + b) % MOD;
    b = (b * 2) % MOD;
  }
  cout << result << endl;
  return 0;
}
