#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
const long long MOD = 1e9 + 7;
int N, M, K, Q;
vector<long long> vec;
int main() {
  int i, j, k;
  string s, t;
  cin >> s;
  long long cnt = 0LL;
  for (i = 0; i < s.size(); ++i) {
    if (s[i] == 'a') {
      cnt++;
    } else if (s[i] == 'b' && cnt != 0LL) {
      vec.push_back(cnt);
      cnt = 0;
    }
  }
  if (cnt != 0LL) vec.push_back(cnt);
  cnt = 1LL;
  for (i = 0; i < vec.size(); ++i) {
    cnt = cnt * (vec[i] + 1) % MOD;
  }
  printf("%lld", cnt - 1);
}
