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 main() {
  char s[100001];
  cin >> s;
  int l = strlen(s);
  int f[l], i, j, p = 1, k = 0;
  for (i = 0, j = 0; i < l; i++) {
    f[i] = 0;
    if (s[i] == 'a') {
      f[j]++;
    }
    if (s[i] == 'b') j++;
  }
  for (i = 0; i < l; i++)
    if (f[i] > 0) {
      p += p * f[i];
      k++;
      p %= 1000000007;
    }
  cout << (p - 1) % 1000000007;
  return 0;
}
