#include <bits/stdc++.h>
using namespace std;
long long Sum(long long n) {
  long long res = 1, x = 2;
  while (n > 0) {
    if (n & 1) res = (res * x) % 1000000007;
    n /= 2;
    x = (x * x) % 1000000007;
  }
  if (res == 0)
    return 1000000007 - 1;
  else
    return res - 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  string s;
  int ans = 0, n = 0;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a')
      n++;
    else {
      ans = (ans % 1000000007 + Sum(n)) % 1000000007;
    }
  }
  cout << ans;
}
