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;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> v;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a')
      v.push_back(1);
    else if (s[i] == 'b')
      v.push_back(0);
  }
  vector<int> cons;
  int m = v.size();
  int flag = 0;
  int num = 0;
  for (int i = 0; i < m; i++) {
    if (v[i] == 1) {
      num++;
      flag = 1;
    }
    if (v[i] == 0 && flag == 1) {
      flag = 0;
      cons.push_back(num);
      num = 0;
    }
    if (i == m - 1 && flag == 1) {
      flag = 0;
      cons.push_back(num);
      num = 0;
    }
  }
  long long ans = 1;
  for (int i = 0; i < cons.size(); i++) {
    ans = (ans * ((cons[i] + 1) % 1000000007)) % 1000000007;
  }
  ans = ans - 1;
  cout << ans;
  return 0;
}
