#include <bits/stdc++.h>
using namespace std;
long long int dp[100005];
long long int cnt[100005];
string st;
long long int n;
int main() {
  string str;
  cin >> str;
  st = "";
  for (int i = 0; i < str.length(); i++)
    if (str[i] == 'a' || str[i] == 'b') st = st + str[i];
  memset(cnt, 0, sizeof cnt);
  for (int i = 0; i < st.length(); i++) {
    if (i == 0 && st[i] == 'a')
      cnt[i] = 1;
    else if (i > 0) {
      if (st[i] == 'a')
        cnt[i] = cnt[i - 1] + 1;
      else
        cnt[i] = cnt[i - 1];
    }
  }
  memset(dp, 0, sizeof(dp));
  int flag = 0, pos = 0;
  for (int i = 0; i < st.length(); i++) {
    if (st[i] == 'a') {
      dp[i] = (1 % 1000000007);
      if (i > 0)
        dp[i] = (dp[i] % 1000000007 + dp[i - 1] % 1000000007) % 1000000007;
      if (i >= 2 && flag)
        dp[i] = (dp[pos] % 1000000007 + dp[i] % 1000000007) % 1000000007;
    } else {
      flag = 1;
      pos = i;
      if (i > 0) dp[i] = dp[i - 1] % 1000000007;
    }
  }
  cout << dp[st.length() - 1] << endl;
}
