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() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  char a[100005];
  int count1 = 1, count2 = 0, i = 0;
  bool first = 0;
  cin >> a;
  while (a[i] != 'a' && a[i] != '\0') i++;
  while (a[i] == 'a') i++, count2++;
  while (a[i] != '\0') {
    first = 0;
    while (a[i] != 'a' && a[i] != '\0') {
      if (a[i] == 'b') first = 1;
      i++;
    }
    if (a[i] == 'a') {
      if (first)
        count1 = ((long long)count1 * (count2 + 1)) % 1000000007, count2 = 0;
      while (a[i] == 'a') count2++, i++;
    }
  }
  count1 = ((long long)count1 * (count2 + 1)) % 1000000007, count2 = 0;
  cout << (count1 - 1 + 1000000007) % 1000000007;
  return 0;
}
