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;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  string a;
  for (long long i = 0; i < (long long)s.size(); i++)
    if (s[i] == 'a' || s[i] == 'b') a += s[i];
  long long n = (long long)a.size();
  vector<long long> arr;
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == 'a') {
      cnt++;
    } else {
      if (cnt) {
        arr.push_back(cnt);
      }
      cnt = 0;
    }
  }
  if (cnt) arr.push_back(cnt);
  n = (long long)arr.size();
  long long ans = 1;
  for (long long i = 0; i < n; i++) {
    ans = (ans * (arr[i] + 1)) % 1000000007;
  }
  ans = (ans - 1) % 1000000007;
  if (ans < 0) ans += 1000000007;
  cout << ans << '\n';
  return 0;
}
