#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1000001, mo = 1e9 + 7;
char s[maxn];
signed main() {
  cin >> (s + 1);
  long long len = strlen(s + 1), anss = 0, ans = 1;
  for (long long i = 1; i <= len; i++) {
    if (s[i] == 'a')
      ans *= 2, ans %= mo;
    else
      anss += ans - 1, anss %= mo;
  }
  cout << anss;
  return 0;
}
