#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long temp = a;
  while (b--) temp = (temp << 1) % 1000000007;
  return temp % 1000000007;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  long long count = 0, na = 0, j = 0, temp = 1;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == 'b') {
      long long t = power(temp, na - j);
      count = (count + power(temp, na - j) - 1) % 1000000007;
      j = na;
      temp = t;
    } else
      na++;
  }
  cout << count % 1000000007;
}
