aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int main() {
  string s;
  cin >> s;
  int siz = s.size();
  long long a = 0, b = 0;
  for (int i = 0; i < siz; i++) {
    if (s[i] == 'a')
      a = (a + b + 1) % 1000000007;
    else if (s[i] == 'b')
      b = a;
  }
  cout << a << endl;
  return 0;
}
