#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int mod = int(1e9) + 7;
const int N = int(1e6) + 7;
long long int two[N];
void pre() {
  two[0] = 1;
  for (int i = (int)1; i < (int)N; i++) {
    two[i] = (two[i - 1] * 2) % mod;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  pre();
  string s;
  cin >> s;
  int cnt = 0;
  long long int ans = 0;
  for (int i = (int)0; i < (int)(int)(s.size()); i++) {
    if (s[i] == 'b') {
      ans = (ans + (two[cnt] - 1)) % mod;
      continue;
    }
    cnt++;
  }
  cout << ans << endl;
  return 0;
}
