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 int before[100005];
long long int after[100005];
long long int prefixa[100005];
long long int modmul(long long int a, long long int b, long long int c) {
  long long int ans = 0;
  a %= c;
  while (b) {
    if (b & 1) {
      ans = ((ans + a) % c);
    }
    b >>= 1;
    a = (a * 2) % c;
  }
  return ans;
}
int main() {
  string s;
  cin >> s;
  long long int len = s.length();
  long long int mod = 1000000007;
  long long int cnta = 0, cntb = 0;
  long long int flag = 0;
  for (long long int i = 0; i < len; i++) {
    if (s[i] == 'a') {
      cnta++;
      flag = 0;
    }
    if ((s[i] == 'b' && i == 0) || (s[i] == 'b' && flag == 0)) {
      before[cntb++] = cnta;
      flag = 1;
    }
    prefixa[i] = cnta;
  }
  long long int cnt = 0;
  flag = 0;
  for (long long int j = 0; j < len; j++) {
    if ((s[j] == 'b' && j == 0) || (s[j] == 'b' && flag == 0)) {
      after[cnt++] = cnta - prefixa[j];
      flag = 1;
    }
    if (s[j] == 'a') {
      flag = 0;
    }
  }
  long long int ans = cnta % mod;
  for (long long int k = 0; k < cnt; k++) {
    ans = (ans + modmul(before[k], after[k], mod)) % mod;
  }
  cout << ans << endl;
  return 0;
}
