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 double pi = acos(-1.0);
const double eps = 1e-8;
const int MX = 1e5 + 5;
const int mod = 1e9 + 7;
char str[MX];
int main() {
  scanf("%s", str);
  int len = strlen(str);
  long long ans = 1, num = 1;
  for (int i = 0; i < len; i++) {
    if (str[i] == 'a')
      num++;
    else if (str[i] == 'b') {
      ans = ans * num % mod;
      num = 1;
    }
  }
  ans = ans * num % mod;
  ans -= 1;
  cout << ans << endl;
  return 0;
}
