#include <bits/stdc++.h>
using namespace std;
void solve();
long long ncr(long long n, long long k) {
  long long res = 1;
  for (long long i = 1; i <= k; ++i) res = (res * (n - k + i)) / i;
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) solve();
  return 0;
}
void solve() {
  string s;
  cin >> s;
  long long n = s.size();
  long long res = 0;
  long long ctb = 0;
  for (long long i = n - 1; i >= 0; i--) {
    if (s[i] == 'a') {
      long long steps = (ctb);
      (res += ctb) %= 1000000007LL;
      ctb = (2 * ctb) % 1000000007LL;
    } else
      (++ctb) %= 1000000007LL;
  }
  cout << res;
  cout << "\n";
  return;
}
