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;
int main() {
  long long int MOD = 1000000007;
  string s;
  cin >> s;
  int n = s.length();
  int dp[n];
  int count = 0, b = 0;
  if (s[0] == 'a') {
    dp[0] = 1;
    count = 1;
  } else {
    dp[0] = 0;
  }
  int ans = count;
  for (int i = 1; i < n; i++) {
    if (s[i] == 'a') {
      dp[i] = (b + 1) % MOD;
      count = (count % MOD + dp[i] % MOD) % MOD;
      ans = (ans % MOD + dp[i] % MOD) % MOD;
    } else if (s[i] == 'b') {
      dp[i] = count;
      b = dp[i];
    }
  }
  cout << ans % MOD << endl;
  return 0;
}
