#include <bits/stdc++.h>
using namespace std;
const long long C = 202020, INF = 1e19, inf = -1e19, mod = 1e9 + 7;
const double eps = 1e-6;
long long q, i, j, k, n, ans, b;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  for (i = s.length() - 1; i >= 0; i--) {
    if (s[i] == 'b')
      b++;
    else if (b) {
      ans += b;
      b *= 2;
      b %= mod;
      ans %= mod;
    }
  }
  cout << ans;
  return 0;
}
