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() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long ans = 1, l, i, k = 0;
  string second;
  cin >> second;
  l = second.length();
  for (i = 0; i < l; i++) {
    if (second[i] == 'a') k++;
    if (second[i] == 'b' || i == l - 1) {
      if (k != 0) ans = (ans * ((k + 1) % 1000000007)) % 1000000007;
      k = 0;
    }
  }
  cout << (ans - 1) % 1000000007;
  return 0;
}
