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 MX = 28, infi = 1000000, mod = 1000000007;
string s;
long long sol, n;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = s.size();
  long long aux = 0, las = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == 'a') {
      sol = 1 + ((sol % mod) + max(0LL, (las - 1) % mod)) % mod;
      aux++;
    } else if (s[i] == 'b') {
      if (aux) {
        if (!las) las = 1;
        if (aux) las = ((las % mod) * ((aux + 1) % mod)) % mod;
        aux = 0;
      }
    }
    sol %= mod;
  }
  cout << sol % mod;
  return 0;
}
