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 int maxn = 1e5 + 5;
char s[maxn];
char help[maxn];
long long dp[maxn];
long long sum[maxn];
const long long mod = 1e9 + 7;
int main() {
  scanf("%s", s);
  int len = strlen(s);
  int i = -1;
  while (s[++i] != 'a')
    ;
  int k = 0;
  for (i; i < len;) {
    if (s[i] == 'a') {
      help[k++] = s[i];
      i++;
    } else {
      if (s[i] == 'b') help[k++] = s[i];
      while (s[i] != 'a') i++;
    }
  }
  int n = k;
  k = 0;
  int cut = 0;
  for (int i = 0; i < n; i++) {
    if (help[i] == 'a')
      cut++;
    else {
      sum[k++] = cut;
      cut = 0;
    }
  }
  sum[k++] = cut;
  n = k;
  long long ans = 1;
  for (int i = 0; i < n; i++) {
    ans = (ans * (sum[i] + 1)) % mod;
  }
  cout << ans - 1 << endl;
  return 0;
}
