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;
int M = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s, t = "";
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'a') t += 'a';
    if (s[i] == 'b' && s[i + 1] != 'b') t += 'b';
  }
  int t1 = 1;
  while (1) {
    int idx = t.find_first_of('b');
    t = t.substr(idx + 1);
    if (idx == 0) continue;
    if (idx == -1) {
      t1 = (t1 % M * (t.length() + 1) % M) % M;
      break;
    }
    t1 = (t1 % M * (idx + 1) % M) % M;
    if (t.length() == 0) break;
  }
  t1--;
  cout << t1 << endl;
}
