#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
long long ans, cnt;
int main() {
  string s;
  cin >> s;
  for (int i = s.length() - 1; i >= -1; i--) {
    if (s[i] == 'a') {
      ans = (ans + cnt) % 1000000007;
      cnt = cnt * 2;
      cnt %= 1000000007;
    } else
      cnt++;
  }
  cout << ans;
  return 0;
}
