#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  long long n = s.size();
  vector<long long> a;
  bool First = 0;
  bool found = 0;
  long long c = 0;
  for (long long i = (0); i < (n); i++) {
    if (s[i] == 'a') {
      c++;
    } else if (s[i] == 'b') {
      if (c == 0) continue;
      a.push_back((c));
      c = 0;
    }
  }
  a.push_back(c);
  long long ans = 1;
  for (long long i = (0); i < (a.size()); i++) {
    ans = (ans * (a[i] + 1)) % 1000000007;
  }
  cout << (ans - 1 + 1000000007) % 1000000007 << "\n";
}
