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;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  long long i, ps, cs;
  i = 0;
  ps = 0;
  cs = 0;
  while (s[i] == 'b' && i < s.length()) i++;
  for (i; i < s.length(); i++) {
    if (s[i] == 'b' && s[i + 1] != 'b') {
      ps = cs;
    }
    if (s[i] == 'a') {
      cs += ps + 1;
    }
  }
  cout << cs % (long long)(10e9 + 7) << endl;
}
