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;
int main() {
  ios::sync_with_stdio(0);
  long long mod = 1e9 + 7;
  string s;
  cin >> s;
  int n = s.size();
  string s1 = "";
  bool b = true;
  int p = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == 'a') p = i;
  for (int i = 0; i <= p; i++) {
    if (s[i] == 'a') {
      s1 += 'a';
      b = false;
    }
    if (s[i] == 'b') {
      if (!b) {
        s1 += 'b';
        b = true;
      }
    }
  }
  long long x = 0;
  long long ans = 0;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] == 'a') {
      ans += x;
      ans++;
      ans %= mod;
    }
    if (s1[i] == 'b') {
      x = ans;
    }
  }
  cout << ans % mod;
  return 0;
}
