#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 5;
long long int power[maxn];
void pre() {
  power[0] = 1;
  for (long long int i = 1; i < maxn; i++) {
    power[i] = (power[i - 1] * 2) % mod;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string str;
  cin >> str;
  long long int size = int(str.size()), i, ans = 0, b = 0, p = 0;
  for (i = size - 1; i >= 0; i--) {
    if (str[i] == 'b') {
      p++;
    } else {
      ans = (ans + (2 * b) % mod) % mod;
      ans = (ans + p - b + mod) % mod;
      b = b + p;
      b %= mod;
      p = b;
    }
  }
  cout << ans;
  return 0;
}
