#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long long act(0), ans(0);
  cin >> s;
  for (int i(s.size() - 1); i >= 0; i--) {
    if (s[i] == 'a')
      ans = (ans + act) % 1000000007, act = 2 * act % 1000000007;
    else
      act++;
  }
  cout << ans;
}
