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 mod = 1e9 + 7;
signed main() {
  string s, t;
  cin >> s;
  for (char c : s)
    if (c == 'a' || c == 'b') t += c;
  long long n = t.length();
  if (!n) {
    cout << 0;
    return 0;
  }
  long long ans = 1, cnt = 0;
  for (long long i = 0; i < n; ++i) {
    if (t[i] == 'a')
      cnt++;
    else
      ans = ans * (cnt + 1) % mod, cnt = 0;
  }
  ans = (ans * (cnt + 1) + mod - 1) % mod;
  cout << ans;
  return 0;
}
