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;
inline char gch() {
  static char buf[100010], *h = buf, *t = buf;
  return h == t && (t = (h = buf) + fread(buf, 1, 100000, stdin), h == t)
             ? EOF
             : *h++;
}
inline void re(long long &x) {
  x = 0;
  char a;
  bool b = 0;
  while (!isdigit(a = getchar())) b = a == '-';
  while (isdigit(a)) x = x * 10 + a - '0', a = getchar();
  if (b == 1) x = -x;
}
const long long mo = 1e9 + 7;
char s[100010];
long long ans = 1, lx;
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  lx = 1;
  for (register int i = 1; i <= len; i++) {
    if (s[i] == 'a')
      lx++;
    else if (s[i] == 'b')
      ans = ans * lx % mo, lx = 1;
  }
  ans = ans * lx % mo;
  cout << ((ans - 1) % mo + mo) % mo;
}
