#include <bits/stdc++.h>
using namespace std;
int dp[100003], v[100003];
char s[100003];
int main() {
  char x;
  long long int nr = 0, i, sum = 0, lg;
  cin >> s;
  lg = strlen(s);
  for (i = 0; i < lg; i++) {
    x = s[i];
    if (x == 'a') v[++nr] = 1;
    if (x == 'b') v[++nr] = 0;
  }
  for (i = 1; i <= nr; i++)
    if (v[i] == 1) {
      if (v[i - 1] == 1)
        dp[i] = dp[i - 1];
      else
        dp[i] = sum + 1;
      sum += dp[i];
      sum %= 1000000007;
    }
  cout << sum;
  return 0;
}
