#include <bits/stdc++.h>
int main() {
  char str[1000010];
  while (~scanf("%s", str)) {
    int count = 0, sum = 0;
    int len = strlen(str);
    for (int i = len - 1; i >= 0; i--) {
      if (str[i] == 'b')
        sum++;
      else {
        count = (count + sum) % 1000000007;
        sum *= 2;
        sum %= 1000000007;
      }
    }
    printf("%d\n", count);
  }
  return 0;
}
