#include <bits/stdc++.h>
using namespace std;
long long MOD, answ = 0, counterb = 0;
int main() {
  iostream::sync_with_stdio(0);
  string s;
  cin >> s;
  counterb = 0;
  answ = 0;
  MOD = pow(10, 9) + 7;
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] == 'b')
      counterb += 1;
    else {
      answ += counterb;
      counterb *= 2;
      counterb %= MOD;
      answ %= MOD;
    }
  }
  cout << answ;
  return 0;
}
