#include <bits/stdc++.h>
using namespace std;
const long long modulo = 1e9 + 7;
int main() {
  int i, nb = 0, na = 0, n = 0;
  int count = 0;
  char str[1000005];
  scanf("%s", &str);
  n = strlen(str);
  for (i = n; i >= 0; i--) {
    char ch = str[i];
    if (ch == 'b') {
      nb++;
    } else {
      count += nb;
      count = count % modulo;
      nb *= 2;
      nb %= modulo;
    }
  }
  cout << count << endl;
}
