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;
long long power(long long a, long long p) {
  if (p == 0) return 1;
  if (p == 1) return a;
  long long tmp = power(a, p / 2);
  if (p % 2)
    tmp = ((tmp * tmp) % 1000000007) * a;
  else
    tmp *= tmp;
  return tmp % 1000000007;
}
long long NUM;
char C;
bool TURN;
long long uf() {
  NUM = 0;
  C = getchar();
  TURN = false;
  while ((C > '9' || C < '0') && C != '-') C = getchar();
  while ((C <= '9' && C >= '0') || C == '-') {
    if (C == '-')
      TURN = true;
    else
      NUM = NUM * 10 + C - '0';
    C = getchar();
  }
  if (TURN) NUM = -NUM;
  return NUM;
}
long long len, a[100005], ap, ans;
char s[100005];
bool b = true;
int main() {
  scanf("%s", s + 1);
  len = strlen(s + 1);
  for (int i = 1; i <= len; i++) {
    if (s[i] == 'b') {
      b = true;
    }
    if (s[i] == 'a') {
      if (b) {
        b = !b;
        ap++;
      }
      a[ap]++;
    }
  }
  ans = 1;
  for (int i = 1; i <= ap; i++) {
    ans *= (a[i] + 1);
    ans %= 1000000007;
  }
  printf("%lld\n", (ans - 1 + 1000000007) % 1000000007);
  return 0;
}
