#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long k = 1;
  long long res = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == 'a') {
      k = (k * 2) % MOD;
    } else {
      res = (res + k % MOD - 1) % MOD;
    }
  }
  cout << res << endl;
  return 0;
}
