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;
const int mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  string s1 = "";
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a' || s[i] == 'b') s1 += s[i];
  }
  long long x = 0;
  long long ans = 1;
  for (int i = 0; i < s1.length(); i++) {
    if (s1[i] == 'a') {
      x++;
    } else {
      if (x) {
        ans = (ans * (x + 1)) % mod;
      }
      x = 0;
    }
  }
  if (x) ans = (ans * (x + 1)) % mod;
  cout << ans - 1;
}
