#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  string S;
  cin >> S;
  long long result = 0;
  long long bCnt = 0;
  for (int i = S.size() - 1; i >= 0; i--) {
    if (S[i] == 'b')
      bCnt++;
    else {
      result = (result + bCnt) % MOD;
      bCnt = (bCnt * 2) % MOD;
    }
  }
  cout << result << endl;
}
