#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<long long> v;
  long long sol = 0;
  int b = 0;
  v.push_back(0);
  long long m = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a') {
      sol++;
      v[b]++;
    } else if (s[i] == 'b') {
      if (v[b] > 0) {
        m = max(m, v[b]);
        v.push_back(0);
        b++;
      }
    }
  }
  sol = 1;
  for (int i = 0; i < v.size(); i++) {
    sol = (sol * (v[i] + 1)) % 1000000007;
  }
  cout << sol - 1;
  return 0;
}
