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 N = 1e5 + 10;
const long long p = 1e9 + 7;
char ch[N];
int main() {
  long long Ans = 1;
  long long S = 0;
  scanf("%s", ch + 1);
  int n = strlen(ch + 1);
  for (int i = 1; i <= n; i++) {
    if (ch[i] == 'a')
      S++;
    else if (ch[i] == 'b')
      Ans *= S + 1, Ans %= p, S = 0;
  }
  Ans *= S + 1;
  Ans--;
  Ans %= p;
  Ans += p;
  Ans %= p;
  cout << Ans << endl;
}
