#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n, sol, flag, bra, dp[100100], tmp;
char s[100100];
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') {
      tmp++;
      tmp %= MOD;
      tmp += sol;
      tmp %= MOD;
    }
    if (s[i] == 'b') {
      sol = tmp;
      sol %= MOD;
    }
  }
  printf("%d", tmp);
  return 0;
}
