#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, i, j, k, l, m, b, t, sum, sum1, flag, max1, min1, tmp;
  string s, s1;
  cin >> s;
  sum = 0;
  sum1 = 0;
  for (i = s.size() - 1; i >= 0; i--) {
    if (s[i] == 'b') {
      sum++;
    } else {
      sum1 += sum;
      sum *= 2;
      sum1 %= 1000000007;
      sum %= 1000000007;
    }
  }
  cout << sum1 << endl;
}
