#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  long long c = 0;
  long long ans = 0;
  int p = s.length() - 1;
  while (p >= 0) {
    if (s[p] == 'b')
      c++;
    else {
      ans += c;
      ans %= mod;
      c = (c * 2) % mod;
    }
    p--;
  }
  cout << ans << endl;
}
