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