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