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 mod = 1e9 + 7;
void solve() {
  string s;
  cin >> s;
  int n = s.length();
  long long c = 0, f = 1;
  long long cnt[n + 1];
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') {
      if (f) {
        c++;
        f = 0;
      }
      cnt[c]++;
    } else {
      if (s[i] == 'b') f = 1;
    }
  }
  long long ans = 1;
  for (int i = 1; i <= n; i++) {
    if (cnt[i] == 0) break;
    ans = (ans * (cnt[i] + 1)) % mod;
  }
  cout << ans - 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
