#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
long long mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string str;
  cin >> str;
  int cnt = 0, ans = 0;
  for (int i = (str.size()) - 1; i >= 0; i--) {
    if (str[i] == 'b')
      cnt++;
    else {
      ans += cnt;
      cnt *= 2;
      cnt %= mod;
      ans %= mod;
    }
  }
  cout << ans << '\n';
}
