aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
int main() {
  char s[100010];
  scanf("%s", s);
  int len = strlen(s);
  int c = 0, ans = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == 'a')
      c++;
    else if (s[i] == 'b') {
      ans = (ans + (ans + 1) % 1000000007 * c % 1000000007) % 1000000007;
      c = 0;
    }
  }
  ans = (ans + (ans + 1) % 1000000007 * c % 1000000007) % 1000000007;
  printf("%d\n", ans);
  return 0;
}
