#include <bits/stdc++.h>
const int M = 1e9 + 7;
char s[1000000 + 6];
int main() {
  scanf("%s", s);
  int n = strlen(s), ans = 0, cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == 'b')
      cnt = (cnt + 1) % M;
    else
      ans = (ans + cnt) % M, cnt = (cnt + cnt) % M;
  }
  printf("%d\n", ans);
  return 0;
}
