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;
const long long MOD = 1000 * 1000 * 1000 + 7;
long long n, temp, ans, ps;
string s;
vector<long long> v;
int32_t main() {
  cin >> s;
  n = s.size();
  for (long long i = 0; i < n; ++i) {
    if (s[i] == 'b') {
      if (temp == 0) continue;
      v.push_back(temp);
      temp = 0;
    }
    if (s[i] == 'a') temp++;
  }
  v.push_back(temp);
  for (long long i = 0; i < v.size(); ++i) {
    ans = (ans + ((v[i] * (ps + 1)) % MOD)) % MOD;
    ps += v[i];
  }
  cout << ans << '\n';
}
