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 e = 10e9 + 7;
int main() {
  string s;
  cin >> s;
  long long last = 0;
  long long num = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == 'a')
      num = (num + last + 1) % e;
    else if (s[i] == 'b') {
      last = num;
    }
  }
  num = num % e;
  cout << num << endl;
  return 0;
}
