#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int main() {
  char a[1000009];
  long long int c = 0, sum = 0;
  cin >> a;
  for (int i = strlen(a) - 1; i >= 0; --i) {
    if (a[i] == 'b')
      c++;
    else {
      sum = (sum + c) % mod;
      c = (c * 2) % mod;
    }
  }
  cout << sum << endl;
  return 0;
}
