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 + 7, M = 1e9 + 7;
int n;
char a[maxn];
vector<int> h;
int main() {
  scanf("%s", a + 1);
  n = strlen(a + 1);
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] == 'a') cnt++;
    if (a[i] == 'b') {
      if (cnt != 0) h.push_back(cnt + 1);
      cnt = 0;
    }
  }
  if (cnt != 0) h.push_back(cnt + 1);
  long long ans = 1;
  for (int t : h) ans = ans * t % M;
  cout << ans - 1;
  return 0;
}
