#include <bits/stdc++.h>
using namespace std;
int mod(int n) {
  int a = n % 1000000007;
  if (a < 0) a += 1000000007;
  return a;
}
int main() {
  string n;
  cin >> n;
  int result = 0;
  int demb = 0;
  for (int i = n.length() - 1; i >= 0; i--) {
    if (n[i] == 'b')
      demb++;
    else {
      result = mod(result + demb);
      demb = mod(demb * 2);
    }
  }
  cout << result;
  cin >> n;
}
