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_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long mod = 1000000007;
  string second;
  cin >> second;
  int n = second.length();
  string s1 = "";
  for (int i = 0; i < n; i++) {
    if (s1.length() == 0 && second[i] != 'a') continue;
    if (second[i] == 'a' || second[i] == 'b') {
      s1 += second[i];
    }
  }
  n = s1.length();
  if (n == 0) {
    cout << 0;
    exit(0);
  }
  int counta = 0;
  int mult = 0;
  int a = 0;
  int ans = 1;
  for (int i = 0; i < n; i++) {
    if (s1[i] == 'a') {
      a++;
      counta++;
    } else if (a) {
      ans = (ans % mod * a % mod) % mod;
      mult++;
      a = 0;
    }
  }
  if (a) {
    ans = (ans % mod * a % mod) % mod;
    mult++;
  }
  if (mult > 1) ans = (ans % mod + counta % mod) % mod;
  cout << ans << '\n';
  return 0;
}
