#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
long long mod = 1000000007;
long long fpow(long long base, long long exp) {
  if (!exp) return 1;
  long long r = fpow(base, exp / 2);
  r = (r * r) % mod;
  if (exp % 2) return (r * base) % mod;
  return r;
}
int main(void) {
  string s;
  cin >> s;
  int cnt = 0;
  long long ans = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'b') {
      ans = (ans + fpow(2, cnt) + (mod - 1)) % mod;
    } else
      cnt++;
  }
  cout << ans << endl;
  return 0;
}
