#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int INF = 213456789;
const double eps = 1e-7;
template <class T>
T gcd(T a, T b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int main() {
  string s;
  cin >> s;
  int now = 1;
  int ans = 0, cnt = 0;
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] == 'b') {
      cnt++;
      cnt %= mod;
    } else {
      ans += cnt;
      ans %= mod;
      cnt *= 2;
      cnt %= mod;
    }
  }
  printf("%d\n", ans);
  return 0;
}
