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