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 + 10, mod = 1e9 + 7;
char s[maxn];
int a[maxn], cnt;
long long d[maxn];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  for (int i = 0; i < n; i++)
    if (s[i] == 'a')
      a[++cnt] = 1;
    else if (s[i] == 'b' && a[cnt] != 0 && cnt)
      a[++cnt] = 0;
  long long ans = 1, res = 1;
  for (int i = 1; i <= cnt; i++) {
    if (a[i] == 1)
      res++;
    else {
      ans = ans * res % mod;
      res = 1;
    }
  }
  ans = ans * res % mod;
  ans = (ans - 1 + mod) % mod;
  cout << ans;
}
