#include <bits/stdc++.h>
using namespace std;
const int MAX = 100010;
const int INF = INT_MAX / 3;
const int MAXLOG = 20;
const long long MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  long long ans = 0;
  long long bs = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == 'a' && bs) {
      long long curbs = 0;
      ans = (ans + bs) % MOD;
      bs = (bs * 2ll) % MOD;
    } else {
      if (s[i] == 'b')
        bs = (bs + 1) % MOD;
      else
        bs = 0;
    }
  }
  cout << ans << "\n";
}
