aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target("avx2")
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  long long n = s.size();
  s = '_' + s;
  const long long MOD = 1e9 + 7;
  long long a = 0, b = 0;
  bool last = false;
  for (long long i = 1; i <= n; i++) {
    if ((s[i] == 'b' and last) or (s[i] != 'a' and s[i] != 'b'))
      continue;
    else if (s[i] == 'a') {
      last = false;
      a += b + 1;
      a %= MOD;
    } else if (s[i] == 'b') {
      last = true;
      b += a;
      b %= MOD;
    }
  }
  cout << a;
  return 0;
}
