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 INF = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long n = s.size();
  vector<long long> left(n, -1);
  long long id = -1;
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'b') id = i;
    left[i] = id;
  }
  vector<long long> dp(n, 0);
  for (long long i = 0; i < n; i++) {
    if (i != 0 && s[i] != 'a')
      dp[i] = dp[i - 1];
    else {
      long long pref = left[i];
      if (pref != -1) dp[i] = dp[pref];
      if (s[i] == 'a') dp[i] = (dp[i] + 1) % INF;
      if (i != 0) dp[i] = (dp[i] + dp[i - 1]) % INF;
    }
  }
  cout << dp[n - 1];
  return 0;
}
