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 int mo = 1e9 + 7;
void solve() {
  string s;
  cin >> s;
  s += 'b';
  long long int ans = 1, cnt = 0;
  long long int n = s.length();
  for (long long int i = 0; i < n; i++) {
    if (s[i] == 'b') {
      ans = (ans * (1 + cnt)) % mo;
      cnt = 0;
    }
    if (s[i] == 'a') cnt++;
  }
  cout << (ans - 1 + mo) % mo << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  { solve(); }
}
