#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<char> a;
  unsigned long long int sum = 0, count = 0;
  long long int n = s.length();
  for (long long int i = (n - 1); i >= 0; i--) {
    if (s[i] == 'a') {
      sum = sum + count;
      count = count * 2;
      count = count % (unsigned long long int)(1000000007);
    } else
      count++;
  }
  cout << sum % (unsigned long long int)(1000000007);
  return 0;
}
