#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long modi(long long a, long long m) { return power(a, m - 2, m); }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  vector<long long> v;
  long long temp = 0;
  for (long long i = s.length() - 1; i >= 0; i--) {
    if (s[i] == 'a') {
      if (temp >= 1) v.push_back(temp);
      temp = 2 * temp;
      temp %= 1000000007;
    } else
      temp++;
  }
  long long ans = 0;
  for (long long i = 0; i < v.size(); i++) {
    ans = (ans + v[i]) % 1000000007;
  }
  cout << ans << endl;
}
