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 = int(1e9) + 7;
string s;
void Tenter() { cin >> s; }
void Tsolve() {
  long long res = 1, cnt = 0;
  s = s + 'b';
  for (int i = 0; i < s.size(); ++i)
    if (s[i] == 'a')
      cnt++;
    else if (s[i] == 'b')
      res = (res % MOD * ((cnt + 1) % MOD)) % MOD, cnt = 0;
  cout << (res - 1) % MOD;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Tenter();
  Tsolve();
  return 0;
}
