aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
const int maxn = 1e5 + 5;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
char s[maxn];
long long dp[3];
void solve() {
  scanf("%s", &s);
  int index = 0;
  dp[0] = dp[1] = dp[2] = 0;
  bool first = true;
  while (s[index]) {
    if (s[index] == 'a') {
      dp[2] = (dp[1] + dp[2]) % mod;
      dp[0] = (dp[0] + 1) % mod;
      first = true;
    } else if (s[index] == 'b' && first) {
      dp[1] = (dp[0] + dp[1]) % mod;
      first = false;
    }
    index++;
  }
  printf("%lld\n", (dp[2] + dp[0]) % mod);
}
int main() {
  solve();
  return 0;
}
