#include <bits/stdc++.h>
using namespace std;
int main() {
  ifstream fin;
  ofstream fout;
  string s;
  cin >> s;
  int c = 0, i = 0, k = 0, j = 1000000007;
  for (i = s.length() - 1; i >= 0; i--) {
    if (s[i] == 'b')
      c++;
    else {
      k += c;
      c *= 2;
      k %= j;
      c %= j;
    }
  }
  cout << k;
  return 0;
}
