#include <bits/stdc++.h>
using namespace std;
long long n, b, ans, i, MOD;
char s[1000007];
int main() {
  MOD = 1000000007;
  scanf("%s", &s);
  n = strlen(s);
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == 'b')
      b = (b + 1) % MOD;
    else {
      ans = (ans + b) % MOD;
      b = (2 * b) % MOD;
    }
  }
  printf("%lld\n", ans % MOD);
}
