#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = 0, i = 0, m1 = 1000000007;
  vector<long long> a(1000000);
  a[0] = 0;
  a[1] = 1;
  for (int i1 = 2; i1 < 1000000; i1++) {
    a[i1] = (a[i1 - 1] * 2 + 1) % m1;
  }
  for (int i2 = 0; i2 < s.size(); i2++) {
    if (s[i2] == 'a') {
      i++;
    } else {
      n += a[i];
      n %= m1;
    }
  }
  cout << n;
  return 0;
}
