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() {
  int n;
  string a;
  cin >> a;
  n = a.length();
  long long c = 0, s = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == 'a') c++;
    if (a[i] == 'b') {
      s = (s * (c + 1)) % 1000000007;
      c = 0;
    }
  }
  s = (s * (c + 1)) % 1000000007;
  s--;
  s = (s + 1000000007) % 1000000007;
  cout << s;
  return 0;
}
