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() {
  long long mod = 1000000007;
  string s;
  cin >> s;
  int n = s.size();
  vector<int> a;
  int t = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') {
      t++;
    }
    if (s[i] == 'b') {
      a.push_back(t + 1);
      t = 0;
    }
  }
  if (t != 0) a.push_back(t + 1);
  long long int k = 1;
  for (int i = 0; i < a.size(); i++) {
    k *= a[i];
    k %= mod;
  }
  cout << k - 1;
}
