#include <bits/stdc++.h>
using namespace std;
string s;
const int mod = 1000000007;
int main() {
  cin >> s;
  long long ans = 0;
  long long num = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == 'b')
      num++;
    else {
      ans += num;
      num <<= 1;
    }
    num = num % mod;
    ans = ans % mod;
  }
  cout << ans << endl;
}
