aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

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