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 long long int MOD = 1e9 + 7;
int main() {
  string str;
  cin >> str;
  int len = str.size();
  long long int ans[100010];
  int num = 0;
  int sum = 0;
  memset(ans, 0, sizeof ans);
  for (int i = 0; i <= len - 1; i++) {
    if (str[i] == 'b') {
      ans[++num] = i;
    } else if (str[i] == 'a') {
      sum++;
    }
  }
  long long int cnt[100010];
  int k = 0;
  for (int i = 1; i <= num; i++) {
    ++k;
    for (int j = ans[i - 1]; j <= ans[i]; j++) {
      if (str[j] == 'a') {
        cnt[k]++;
      }
    }
    if (cnt[k] == 0) {
      --k;
    }
  }
  long long int p = 0;
  for (int i = num; i <= len - 1; i++) {
    if (str[i] == 'a') {
      p++;
    }
  }
  if (p != 0) {
    cnt[++k] = p;
  }
  if (k != 1) {
    long long int g = 1;
    long long int h = 0;
    for (int i = 1; i <= k; i++) {
      g = (g * cnt[i]) % MOD;
    }
    g = g % MOD;
    if (g == 1) {
      h = 0;
    } else
      h = g;
    long long int l = (h % MOD + sum % MOD) % MOD;
    cout << l << endl;
  } else {
    cout << sum % MOD << endl;
  }
  return 0;
}
