#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
vector<long long int> pos;
int main() {
  string s;
  cin >> s;
  int len = s.size();
  int count = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == 'a') {
      count++;
    }
    if (s[i] == 'b' && count != 0) {
      pos.push_back(count);
      count = 0;
    }
  }
  pos.push_back(count);
  int kol = pos.size();
  long long int ans = 1;
  for (int i = 0; i < kol; i++) {
    ans *= (pos[i] + 1);
    ans %= mod;
  }
  ans--;
  if (ans < 0) ans += mod;
  cout << ans;
  return 0;
}
