#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N = 1e5 + 1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  string s;
  cin >> s;
  vector<long long> count;
  long long cur = 0, i = 0, ans = 1, sum = 0, n = s.size();
  while (i < n) {
    while (i < n and s[i] != 'b') {
      cur += (s[i] == 'a');
      i++;
    }
    if (cur) count.push_back(cur);
    cur = 0;
    i++;
  }
  if (count.size()) {
    for (long long i : count) ans = (ans * (i + 1)) % mod;
    ans--;
  } else
    ans = 0;
  cout << ans;
}
