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;
const int M = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  int a = 0, b = 0, count = 0;
  vector<int> v;
  getline(cin, s);
  int l = s.length();
  for (int i = 0; i < l; i++) {
    if (s[i] == 'a') {
      if (a > 0 && b > 0) {
        v.push_back(count);
        count = 0;
      }
      b = 0;
      count++;
      a++;
      continue;
    }
    if (s[i] == 'b' && a > 0) b++;
  }
  v.push_back(count);
  long long t = 1;
  for (int i = 0; i < v.size(); i++) {
    t *= (v[i] + 1);
    t %= M;
  }
  cout << t - 1;
  return 0;
}
