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;
  long long ans = 1;
  for (int i = 0; i < s.length(); i++) {
    int cnt = 0;
    int j = i;
    while (j < s.length()) {
      if (s[j] == 'a')
        cnt++, j++;
      else if (s[j] == 'b') {
        break;
      } else
        j++;
    }
    ans = ans * (cnt + 1) % 1000000007;
    i = j;
  }
  ans--;
  cout << ans << "\n";
  return 0;
}
