#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int n = s.size(), sum = 0, c = 0;
  for (long long int i = n - 1; i >= 0; i--) {
    if (s[i] == 'b')
      c++;
    else {
      sum = (sum + c) % 1000000007;
      c = (2 * c) % 1000000007;
    }
  }
  cout << (sum % 1000000007) << "\n";
}
