#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  long long int ans = 1;
  int cnt = 0;
  int n = s.size();
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'a') cnt++;
    if (s[i] == 'b') {
      cnt++;
      ans = ans * cnt;
      ans %= mod;
      cnt = 0;
    }
  }
  ans = ans * (cnt + 1);
  ans = (ans - 1 + mod) % mod;
  cout << ans << "\n";
}
