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 N = 1e5 + 5;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long i, n, ans = 0, ab4bcnt = 0, aafterbcnt = 0;
  string s;
  cin >> s;
  n = (long long)s.length();
  for (i = 0; i < n; i++) {
    if (s[i] == 'a') {
      ans = (ans + ab4bcnt + 1) % 100000007;
      aafterbcnt = (aafterbcnt + 1) % 100000007;
    }
    if (s[i] == 'b') {
      ab4bcnt = (ab4bcnt + aafterbcnt) % 100000007;
      aafterbcnt = 0;
    }
  }
  cout << ans;
  return 0;
}
