#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long long int p = 1e9 + 7;
  long long int n, i, bcnt = 0, ans = 0;
  cin >> s;
  for (i = s.size() - 1; i >= 0; i--) {
    if (s[i] == 'b')
      bcnt++;
    else {
      ans = (ans + bcnt) % p;
      bcnt = (bcnt * 2) % p;
    }
  }
  cout << ans << endl;
}
