#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
string s;
int main() {
  cin >> s;
  long long ans = 0;
  long long now = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'b') {
      now = ans;
    } else if (s[i] == 'a') {
      ans = (ans + now + 1) % mod;
    }
  }
  cout << ans << endl;
  return 0;
}
