#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = 3.141592653589793238462;
const int dr[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dc[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const long long MOD = 1000000007;
template <typename T>
T modpow(T a, T b, T mod) {
  T res = 1;
  while (b) {
    if (b & 1) {
      res *= a, res %= mod;
    }
    a *= a, a %= mod;
    b /= 2;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  string s;
  cin >> s;
  long long a = 0, ans = 0;
  for (auto ch : s) {
    if (ch == 'a')
      a++;
    else {
      ans += modpow(2LL, a, MOD) - 1LL;
      ans %= MOD;
    }
  }
  cout << ans << '\n';
  return 0;
}
