#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string str, temp;
  string a;
  cin >> temp;
  a = temp;
  int j;
  while (temp[j] != 'a' and j < temp.length()) j++;
  for (int i = j; i < temp.length(); i++) {
    if (temp[i] == 'a') str.push_back(temp[i]);
    if (temp[i] == 'b') {
      str.push_back('b');
      while (temp[i] != 'a') i++;
      i--;
    }
  }
  int last = 0;
  int n = str.length();
  vector<long long> dp(n + 1, 0);
  for (int i = 1; i < n + 1; i++) {
    dp[i] = dp[i - 1];
    if (str[i - 1] == 'a') {
      dp[i]++;
      dp[i] = (dp[i] + dp[last]) % 1000000007;
    } else {
      last = i;
    }
  }
  cout << dp[str.length()] << endl;
}
