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;
  cin >> s;
  string s1 = "";
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'a' || s[i] == 'b') s1 += s[i];
  }
  vector<int> v;
  int strt = 0;
  while (strt < s1.length() && s1[strt] != 'a') {
    strt++;
  }
  int cnt = 0;
  for (int i = strt; i < s1.length(); i++) {
    if (s1[i] == 'b') {
      v.push_back(cnt);
      cnt = 0;
      while (i < s1.length() && s1[i] == 'b') i++;
      if (i < s1.length() && s[i] == 'a') i--;
    } else
      cnt++;
  }
  if (cnt > 0) v.push_back(cnt);
  long long num = 1;
  for (int i = 0; i < v.size(); i++) {
    num = (num * (v[i] + 1)) % 1000000007;
  }
  if (num == 0)
    cout << "1000000006\n";
  else
    cout << num - 1 << "\n";
  return 0;
}
