#include <bits/stdc++.h>
using namespace std;
const int a1[4][4] = {{0, 1, 2, 3}, {1, 1, 3, 3}, {2, 3, 2, 3}, {3, 3, 3, 3}};
const int b1[4][4] = {{0, 0, 0, 0}, {0, 1, 0, 1}, {0, 0, 2, 2}, {0, 1, 2, 3}};
const int N = 3e5 + 5;
long long mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  long long ans = 1;
  long long ct = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'b') {
      ans *= (ct + 1);
      ans %= mod;
      ct = 0;
    } else if (s[i] == 'a')
      ct++;
  }
  ans *= (ct + 1);
  ans %= mod;
  cout << ans - 1 << '\n';
  return 0;
}
