#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 100005;
int n, m, Q, T;
string s;
int main() {
  cin >> s;
  n = s.size();
  long long int ans = 0, cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == 'a') {
      ans = (ans + cnt) % MOD;
      cnt = cnt * 2 % MOD;
    } else
      cnt++;
  }
  printf("%lld\n", ans);
  return 0;
}
