#include <bits/stdc++.h>
using namespace std;
template <typename T>
void input(vector<T> &v, long long n) {
  long long i;
  T x;
  for (i = 0; i < n; ++i) {
    cin >> x;
    v.push_back(x);
  }
}
const long long inf = 1e17 + 7;
const int infi = 1e9 + 7;
const long long mod = 1e9 + 7;
vector<long long> sieve(long long n) {
  bool prime[n + 1];
  vector<long long> vect;
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long p = 2; p <= n; p++)
    if (prime[p]) vect.push_back(p);
  return vect;
}
void solve() {
  int n, b = 0, a = 0, m = 1e9 + 7;
  string s;
  cin >> s;
  for (n = s.size() - 1; n > -1; n--) {
    if (s[n] == 'b')
      b++;
    else {
      a = (a + b) % m;
      b = (b * 2) % m;
    }
  }
  cout << a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
