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 long long mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 5;
char s[N], c[N];
int main() {
  cin >> c + 1;
  int len = strlen(c + 1);
  int num = 0;
  for (int i = 1; i <= len; i++) {
    if (c[i] == 'a' || c[i] == 'b') s[++num] = c[i];
  }
  long long sum = 0, ans = 1;
  int i = 1;
  while (s[i] == 'b') i++;
  while (i <= num) {
    if (s[i] == 'a')
      sum++;
    else
      ans = (ans * (sum + 1) % mod) % mod, sum = 0;
    i++;
  }
  ans = (ans * (sum + 1) % mod) % mod;
  cout << ans - 1 << endl;
}
