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 double pi = 2 * acos(0.0);
const int maxn = 3e5 + 5;
char s[maxn];
long long dp[maxn];
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  long long cnt = 0;
  for (int i = 1; i <= len; i++) {
    dp[i] = dp[i - 1];
    if (s[i] == 'a')
      dp[i] = ((dp[i] + cnt) + 1) % 1000000007;
    else if (s[i] == 'b')
      cnt = dp[i];
  }
  printf("%I64d\n", dp[len]);
  return 0;
}
