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;
long long mod = 1000000007;
long long n, i, j, k, nr, v[100005], rz, nv;
string s;
int main() {
  cin >> s;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'a') nr++;
    if (s[i] == 'b') {
      if (nr) v[++nv] = nr;
      nr = 0;
    }
  }
  if (nr) v[++nv] = nr;
  rz = v[1];
  for (i = 2; i <= nv; i++) rz = (v[i] * (rz + 1) + rz) % mod;
  cout << rz << "\n";
}
