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