aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, d;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a' || s[i] == 'b') d += s[i];
  }
  int n = d.size();
  vector<long long int> v;
  int i = 0;
  while (i < n) {
    if (d[i] == 'a') {
      int k = 0;
      while (i < n && d[i] == 'a') {
        i++;
        k++;
      }
      v.push_back(k);
    } else
      i++;
  }
  long long int ma = 1e9 + 7;
  if (v.size() == 0) {
    cout << "0\n";
    return 0;
  }
  long long int ans = v[0];
  for (int i = 1; i < v.size(); i++) {
    long long h = ((v[i] % ma) * (v[i - 1] % ma)) % ma;
    v[i] = (v[i] % ma + ((h % ma) + (v[i - 1] % ma)) % ma) % ma;
  }
  cout << v[v.size() - 1] << "\n";
}
