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;
int main() {
  string str;
  cin >> str;
  int flag = 0;
  long long ans = 0;
  long long temp = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == 'a') {
      ans++;
      ans += temp;
      ans %= mod;
      flag++;
      flag %= mod;
    } else if (str[i] == 'b') {
      temp = flag;
      temp %= mod;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
