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 int N = 1000010;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long ans = 1, cnt = 0;
  bool ok = 1;
  string s;
  cin >> s;
  long long x = (pow(10, 9) + 7);
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == 'a') {
      ok = 0;
      cnt++;
    } else if (s[i] == 'b') {
      ok = 1;
      ans *= (cnt + 1);
      cnt = 0;
    }
    ans %= x;
  }
  if (ok == 0) {
    ans *= (cnt + 1);
  }
  ans--;
  cout << ans % x;
  return 0;
}
