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 hell = 1000000000 + 7;
  string s;
  cin >> s;
  int l = s.length();
  int i;
  vector<int> count1(l, 0);
  int j = 0;
  for (i = 0; i < l; i++) {
    if (s[i] == 'a') count1[j]++;
    if (s[i] == 'b') j++;
  }
  unsigned long long ans = 1;
  for (i = 0; i < count1.size(); i++) {
    if (count1[i] == 0) {
      ;
    } else {
      ans = ans * ((count1[i] + 1) % hell);
    }
  }
  ans = ans % hell;
  ans = (ans - 1) % hell;
  cout << ans;
  return 0;
}
