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