#include <bits/stdc++.h>
using namespace std;
const int Mod = 1000000007;
char s[1000010];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  int cur = 0, ans = 0;
  for (int i = n; i >= 1; i--)
    if (s[i] == 'a') {
      ans = (ans + cur) % Mod;
      cur = cur * 2ll % Mod;
    } else
      cur = (cur + 1) % Mod;
  printf("%d\n", ans);
  return 0;
}
