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