#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long int fast_exp(int b, int p) {
  if (p == 0) return 1LL;
  if (p & 1) return (1LL * b * fast_exp(b, p - 1)) % mod;
  return fast_exp((1LL * b * b) % mod, p / 2);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long int c = 0, sol = 0;
  for (int i = (0); i <= (((int)(s).size()) - 1); ++i) {
    if (s[i] == 'a')
      c++;
    else {
      sol = (sol + fast_exp(2, c) - 1 + mod) % mod;
    }
  }
  cout << sol << '\n';
  return 0;
}
