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 long long maxn = 5e3 + 10;
const long long mod = 1e9 + 7;
int32_t main() {
  string ss;
  cin >> ss;
  long long num = 0;
  long long x = 0;
  long long y = 0;
  for (long long i = 0; i < ss.size(); i++) {
    if (ss[i] == 'a') {
      num++;
      if (y) num += y;
      x++;
    }
    if (ss[i] == 'b') {
      y = x;
      y = y % mod;
    }
    num = num % mod;
  }
  cout << num % mod << endl;
}
