#include <bits/stdc++.h>
using namespace std;
int dp[100002];
const int mod = 1e9 + 7;
string s;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  dp[0] = 1;
  dp[1] = 1;
  int lol = 1;
  for (int i = 2; i <= n + 1; i++) {
    dp[i] = dp[i - 1];
    if (s[i - 2] == 'a') dp[i] += dp[lol - 1];
    if (s[i - 2] == 'b') lol = i;
    dp[i] %= int(1e9 + 7);
  }
  cout << dp[n + 1] - 1;
  return 0;
}
