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 N = 1e5 + 5;
const int32_t MOD = 1e9 + 7;
string s;
long long f[N][3];
int32_t main() {
  cin >> s;
  long long len = s.size();
  for (long long i = 0; i < len;) {
    if (s[i] != 'a' && s[i] != 'b') {
      s.erase(i, 1);
      --len;
      continue;
    }
    ++i;
  }
  s.insert(s.begin(), 's');
  for (long long i = 1; i <= len; ++i) {
    if (s[i] == 'a') {
      f[i][1] = (f[i - 1][2] + 1 + f[i - 1][1]) % MOD;
      f[i][2] = f[i - 1][2];
    } else {
      if (s[i - 1] == 'a')
        f[i][2] = (f[i - 1][1] + f[i - 1][2]) % MOD;
      else
        f[i][2] = f[i - 1][2];
      f[i][1] = f[i - 1][1];
    }
  }
  cout << f[len][1] << endl;
  return 0;
}
