#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int main() {
  string s;
  cin >> s;
  int siz = s.size();
  long long a = 0, b = 0;
  for (int i = 0; i < siz; i++) {
    if (s[i] == 'a')
      a = (a + b + 1) % 1000000007;
    else if (s[i] == 'b')
      b = a;
  }
  cout << a << endl;
  return 0;
}
