#include <bits/stdc++.h>
using namespace std;
long long f[1000110];
string s;
int main() {
  long long cs, t, i, j, k, x, y, z, ans, q, m, n;
  f[1] = 1;
  long long tp = 2;
  long long mod = 1000000007;
  for (i = 2; i <= 1000108; i++) {
    f[i] = (f[i - 1] + tp) % mod;
    tp = (tp * 2) % mod;
  }
  while (cin >> s) {
    x = 0;
    ans = 0;
    for (i = 0; i < s.size(); i++) {
      if (s[i] == 'a')
        x++;
      else {
        if (x == 0)
          continue;
        else {
          ans = (ans + f[x]) % mod;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
