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;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  string second;
  cin >> second;
  vector<long long int> v;
  long long int add = 0;
  long long int ans = 0;
  bool flag = false;
  long long int count = 0;
  for (long long int i = 0; i < second.length(); i++) {
    if (second[i] == 'a') {
      add++;
      flag = false;
    }
    if (second[i] == 'b' && flag == false) {
      v.push_back(add);
      ans += add % 1000000007;
      add = 0;
      flag = true;
      count++;
    }
  }
  if (count) {
    v.push_back(add);
  }
  ans += add % 1000000007;
  long long int val = 0;
  if (v.size() > 0) {
    val = 1;
    for (long long int i = 0; i < v.size(); i++) {
      val = ((val % 1000000007) * (v[i] % 1000000007)) % 1000000007;
    }
  }
  ans += val;
  cout << ans << '\n';
}
