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 mod = 1e9 + 7;
string s, s1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> s;
  int n = s.size();
  long long ans = 1;
  for (int i = 0; i < n; i++) {
    long long cnt = 0;
    int x = i;
    while (x < n) {
      if (s[x] == 'a')
        cnt++, x++;
      else if (s[x] == 'b')
        break;
      else
        x++;
    }
    i = x;
    ans = ans * (cnt + 1) % mod;
  }
  ans--;
  cout << ans << endl;
}
