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;
long long largestDivisor(long long n) {
  for (long long i = n - 1; i >= 0; i--) {
    if (n % i == 0) {
      return i;
    }
  }
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  string s;
  cin >> s;
  long long ans = 1;
  long long mod = 1e9 + 7;
  long long n = 0;
  string r = s;
  sort(r.begin(), r.end());
  if (s[0] - 'b' > 0) {
    cout << 0;
    return 0;
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != 'a' && s[i] != 'b') {
      s.erase(i, i);
      i -= 1;
    }
  }
  int cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a') {
      cnt += 1;
    } else {
      ans = (ans * (cnt + 1)) % mod;
      cnt = 0;
    }
  }
  ans = (ans * (cnt + 1)) % mod;
  ans = (ans - 1 + mod) % mod;
  cout << ans << endl;
}
