#include <bits/stdc++.h>
using namespace std;
const long long p = (long long)(1e9 + 7);
int main() {
  ios_base::sync_with_stdio(0);
  string s;
  cin >> s;
  s += 'b';
  int n = (int)s.size();
  long long answer = 0;
  long long cnt = 0;
  bool lol = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') {
      cnt++;
    }
    if (s[i] == 'b') {
      answer += (answer + 1) * cnt;
      answer %= p;
      cnt = 0;
    }
  }
  cout << answer;
  return 0;
}
