#include <bits/stdc++.h>
using namespace std;
long long solve(long long a, long long b, long long mod) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return solve((a * a) % mod, b / 2, mod);
  else
    return (a * solve((a * a) % mod, (b - 1) / 2, mod)) % mod;
}
int main() {
  string w;
  long long x = 0, y = 0;
  cin >> w;
  for (int i = 0; i < w.size(); i++) {
    if (w[i] == 'a')
      y = (y + 1) % 1000000007;
    else {
      x = (x + (solve(2, y, 1000000007) - 1)) % 1000000007;
    }
  }
  cout << x % 1000000007;
  return 0;
}
