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 int mod = 1e9 + 7;
void madd(int &a, int b) {
  if ((a += b) > mod) a -= mod;
}
int n;
string s;
int dp[100005];
int main() {
  cin >> s;
  n = s.size();
  int run = 0, blk = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') {
      madd(dp[i], 1 + run);
      madd(blk, dp[i]);
    } else if (s[i] == 'b') {
      madd(run, blk);
      blk = 0;
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == 'a') madd(dp[n], dp[i]);
  }
  cout << dp[n] << '\n';
  return 0;
}
