#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long long cont = 0;
  long long ans = 0;
  cin >> s;
  while (s.back() == 'a') {
    s.pop_back();
  }
  for (int i = s.size() - 1; i > -1; i--) {
    if (s[i] == 'b') {
      cont += 1;
      cont %= 1000000007;
    }
    if (s[i] == 'a') {
      ans += (cont + ans) % 1000000007;
    }
  }
  cout << ans % 1000000007;
}
