#include <bits/stdc++.h>
using namespace std;
int main() {
  char data[100100];
  long long ans = 0, dp[100100] = {0};
  scanf("%s", data);
  int l = strlen(data);
  int b = 1, flag = 0;
  for (int i = 1; i <= l; i++) {
    if (data[i - 1] == 'a') {
      dp[i] = 1 + dp[i - 1] + dp[b - 1];
    } else if (data[i - 1] == 'b') {
      b = i;
      dp[i] = dp[i - 1];
    } else
      dp[i] = dp[i - 1];
    dp[i] %= 1000000007;
  }
  printf("%I64d", dp[l]);
  return 0;
}
