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 int MAXN = 1e5 + 5;
const long long mod = 1e9 + 7;
int end_a[MAXN];
int end_b[MAXN];
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  string s;
  cin >> s;
  long long ans = 0;
  int A = 0, B = 1;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == 'a') {
      ans = (ans + B) % mod;
      A = (A + B) % mod;
    } else if (s[i] == 'b') {
      B = (A + B) % mod;
      A = 0;
    }
  }
  cout << ans;
}
