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