#include <bits/stdc++.h>
using namespace std;
int main() {
  string in;
  cin >> in;
  long long prev = 0;
  long long total = 0;
  for (int i = 0; i < in.length(); i++) {
    if (in[i] == 'a') {
      total += prev + 1;
      total %= 1000000007;
    } else if (in[i] == 'b') {
      prev = total;
    }
  }
  cout << total;
}
