#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  vector<int> a;
  int cnt = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'a')
      cnt++;
    else if (s[i] == 'b') {
      a.push_back(cnt);
      cnt = 0;
    }
  }
  a.push_back(cnt);
  long long ans = 1;
  for (int item : a) {
    ans *= (item + 1) * 1ll;
    ans %= mod;
  }
  cout << ans - 1 << "\n";
  return 0;
}
