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 int power(long long int x, long long int n, long long int m) {
  if (n == 0) return 1;
  if (n == 1) return x;
  x %= m;
  if (n % 2) return (x * (power((x * x) % m, n / 2, m) % m)) % m;
  return power((x * x) % m, n / 2, m) % m;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int mod = 1e9 + 7;
  string s;
  cin >> s;
  long long int num = 0, ans = 1;
  vector<long long int> v;
  for (long long int i = 0; i < s.length(); i++) {
    if (s[i] == 'a') num++;
    if (s[i] == 'b' || (i == s.length() - 1)) {
      v.push_back(num);
      num = 0;
    }
  }
  for (long long int i = 0; i < v.size(); i++) v[i]++;
  for (long long int i = 0; i < v.size(); i++) {
    ans *= v[i];
    ans %= mod;
  }
  ans--;
  if (ans < 0) ans += mod;
  ans %= mod;
  cout << ans << endl;
}
