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;
long long n, m, k, a[100005], b[100005];
vector<long long> v;
set<long long> st;
long long pow2[100005];
long long nen2(long long n) { return (n * n - 1) / 2; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  pow2[0] = 1;
  for (int i = 1; i < 100005; ++i) {
    pow2[i] = (pow2[i - 1] * 2) % 1000000007;
  }
  string s;
  cin >> s;
  int l = s.length();
  int i = 0;
  while (i < l && s[i] != 'a') i++;
  if (i == l) {
    cout << 0;
    return 0;
  }
  int foundB;
  vector<long long> bl;
  int curr = 0;
  for (; i < l; i++) {
    if (s[i] == 'a') {
      curr++;
      foundB = 0;
    } else if (s[i] == 'b' && curr) {
      foundB = 1;
      bl.push_back(curr);
      curr = 0;
    }
  }
  if (curr) bl.push_back(curr);
  int cntA = bl.size();
  long long ans = pow2[cntA] - 1;
  for (int i = 0; i < cntA; ++i) {
    ans = (ans + ((bl[i] - 1) * pow2[cntA - 1]) % 1000000007) % 1000000007;
  }
  cout << ans;
  return 0;
}
