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 MOD = pow(10, 9) + 7;
long long ans = 0;
void add(int b) {
  ans += b;
  if (ans < 0) ans += MOD;
  if (ans >= MOD) ans -= MOD;
}
int main() {
  string s;
  cin >> s;
  int prev = 0;
  int d = 0;
  int q = 0;
  bool add_a = false;
  vector<int> a;
  for (size_t i = 0; i < s.size(); i++) {
    if (s[i] == 'a') {
      d++;
      add_a = true;
    } else if (s[i] == 'b') {
      if (!add_a) continue;
      a.push_back(d);
      ans += d;
      d = 0;
      add_a = false;
    }
  }
  if (add_a) {
    a.push_back(d);
    ans += d;
  }
  long long sum = 1;
  for (size_t i = 0; i < a.size(); i++) {
    sum *= a[i];
  }
  add(sum);
  cout << ans << endl;
  return 0;
}
