#include <bits/stdc++.h>
using namespace std;
const long long INF = 4000000000000000000LL;
const long long mod = 1000000007LL;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  long long b = 0;
  long long ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == 'b')
      b++;
    else {
      ans = (ans + b) % mod;
      b = (b * 2) % mod;
    }
  }
  cout << ans << endl;
}
