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 modulo = 1000000007;
int main() {
  string s;
  cin >> s;
  long long one = 0;
  vector<long long> v1;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == 'a')
      one++;
    else if (s[i] == 'b') {
      v1.push_back(one);
      one = 0;
    }
  }
  if (one != 0) v1.push_back(one);
  long long ans = 1;
  for (long long i = 0; i < v1.size(); i++) {
    ans = ((ans % modulo) * ((v1[i] + 1) % modulo) % modulo) % modulo;
  }
  cout << (ans - 1 + modulo) % modulo;
}
