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;
mt19937 myRand(1337);
int main() {
  string s;
  cin >> s;
  vector<int> q = {0};
  for (int i = 0, t = 0; i < s.length(); ++i) {
    if (t == 0) {
      if (s[i] == 'b')
        q.push_back(0), t = 1;
      else if (s[i] == 'a')
        q.back()++;
    } else {
      if (s[i] == 'a') q.push_back(1), t = 0;
    }
  }
  long long dp = q[0];
  for (int i = 1; i < q.size(); ++i) {
    dp = (dp * (long long)q[i] + dp + q[i]) % 1000000007;
  }
  cout << dp;
}
