#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, t = 1, k, i = 0, j, p = 1, sum = 0;
  string s;
  cin >> s;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == 'a')
      p = p * 2 % 1000000007;
    else
      sum = sum % 1000000007 + (p - 1);
  }
  cout << sum % 1000000007;
}
