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() {
  char a[1233455];
  cin >> a;
  long long int i, n, j = 1, k;
  for (n = 0; a[n] != '\0'; n++)
    ;
  k = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == 'a')
      k++;
    else if (a[i] == 'b') {
      j = (j * (k + 1)) % 1000000007;
      k = 0;
    }
  }
  if (k != 0) {
    j = (j * (k + 1)) % 1000000007;
  }
  cout << j - 1;
  return 0;
}
