#include <bits/stdc++.h>
using namespace std;
char input[1000005];
int main() {
  scanf("%s", input);
  int len = strlen(input), cb = 0, ca = 0;
  for (int i = len - 1; i >= 0; i--) {
    if (input[i] == 'a') {
      ca += cb;
      ca %= 1000000007;
      cb *= 2;
      cb %= 1000000007;
    }
    if (input[i] == 'b') {
      cb++;
      cb %= 1000000007;
    }
  }
  printf("%d\n", ca);
}
