#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int t = 0, a = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == 'a') {
      t = t + a;
      t = t % 1000000007;
      ;
      a = a * 2;
      a = a % 1000000007;
      ;
    } else {
      a++;
      a = a % 1000000007;
      ;
    }
  }
  cout << t;
}
