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;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long n = s.length();
  long long dp[n][2];
  dp[0][0] = (s[0] == 'a');
  dp[0][1] = 0;
  for (long long i = 1; i < n; i++) {
    char c = s[i];
    if (c == 'a') {
      dp[i][0] = ((dp[i - 1][0] % 1000000007 + dp[i - 1][1] % 1000000007) %
                      1000000007 +
                  1) %
                 1000000007;
      dp[i][1] = dp[i - 1][1];
    } else if (c == 'b') {
      dp[i][0] = dp[i - 1][0];
      dp[i][1] = dp[i - 1][0];
    } else {
      dp[i][1] = dp[i - 1][1];
      dp[i][0] = dp[i - 1][0];
    }
  }
  cout << dp[n - 1][0] << " ";
  return 0;
}
