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