#include <bits/stdc++.h>
using namespace std;
long long int brr[2000009], crr[2000009], arr[2000009];
char c[2000009];
int main() {
  int test_case = 1;
  for (int cs = 1; cs <= test_case; cs++) {
    long long int a1 = 0, ans = 0;
    scanf("%s", &c);
    for (int i = strlen(c) - 1; i >= 0; i--) {
      if (c[i] == 'b')
        a1 = (a1 + 1) % 1000000007;
      else {
        ans = (ans + a1) % 1000000007;
        a1 = (a1 + a1) % 1000000007;
      }
    }
    printf("%lld\n", ans);
  }
  return 0;
}
