#include <bits/stdc++.h>
using namespace std;
inline void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long int mod = (long long int)(1e9) + 7;
long long int nb = 0, ans = 0;
int main() {
  fast();
  string s;
  cin >> s;
  int n = s.size();
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == 'b')
      nb = (nb + 1LL) % mod;
    else {
      ans = (ans + nb) % mod;
      nb = (nb * 2) % mod;
    }
  }
  cout << ans << endl;
}
