#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  int pot = 1, ans = 0;
  for (char c : s) {
    if (c == 'a')
      pot += pot, pot %= MOD;
    else {
      ans += pot - 1;
      if (ans >= MOD) ans -= MOD;
    }
  }
  cout << ans << endl;
}
