#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
int main() {
  string s;
  cin >> s;
  int count = 0;
  int sum = 0;
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] == 'b') {
      count++;
    } else {
      sum += count;
      count = count * 2;
      sum = sum % mod;
      count = count % mod;
    }
  }
  cout << sum;
  return 0;
}
