#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.length(), count = 0;
  long long int ans = 1, p = 1000000007;
  for (int i = 0; i < l; i++) {
    if (s[i] == 'a')
      count++;
    else if (s[i] == 'b') {
      ans = (ans * (count + 1)) % p;
      count = 0;
    }
  }
  ans = (ans * (count + 1)) % p;
  cout << (ans - 1) % p;
  return 0;
}
