#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
long long m = 1000000007;
int main() {
  string s;
  cin >> s;
  long long mainans = 1;
  long long counter = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == 'a') counter++;
    if (s[i] == 'b' && counter) {
      mainans = (mainans % m * (counter + 1) % m) % m;
      counter = 0;
    }
  }
  mainans = (mainans % m * (counter + 1) % m) % m;
  cout << mainans - 1 << endl;
}
