#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x = -1, num = -1, sum = 0;
  string A;
  cin >> A;
  vector<long long> V(A.size());
  for (long long i = 0; i < A.size(); i++) {
    if (A[i] == 'a') {
      num = i;
      V[i] = sum + 1;
    } else if (A[i] == 'b') {
      while (x < num) {
        x++;
        sum += V[x];
        sum = sum % 1000000007;
      }
    }
  }
  while (x < A.size() - 1) {
    x++;
    sum += V[x];
    sum = sum % 1000000007;
  }
  cout << sum;
  return 0;
}
