#include <bits/stdc++.h>
using namespace std;
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  string str;
  cin >> str;
  long long ans = 0;
  int bCounter = 0;
  for (int i = str.size() - 1; i >= 0; i--) {
    if (str[i] == 'b')
      bCounter++;
    else {
      ans = (bCounter + ans) % 1000000007;
      bCounter = (bCounter * 2) % 1000000007;
    }
  }
  cout << ans;
  return 0;
}
