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