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 MOD = 1e9 + 7;
int add(int a, int b) {
  int res = a + b;
  if (res >= MOD) res -= MOD;
  return res;
}
const int N = 1e5 + 5;
int dp[N][2];
string w;
int solve(int p, bool has_b) {
  if (p >= (int)w.size()) return 1;
  int &res = dp[p][has_b];
  if (~res) return res;
  res = 0;
  if (w[p] == 'b') {
    res = add(res, solve(p + 1, true));
  } else if (w[p] == 'a') {
    if (has_b) res = add(res, solve(p + 1, false));
    res = add(res, solve(p + 1, has_b));
  } else {
    res = add(res, solve(p + 1, has_b));
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  memset(dp, -1, sizeof(dp));
  cin >> w;
  int ans = 0;
  for (int i = 0; i < (int)w.size(); i++) {
    if (w[i] == 'a') {
      ans = add(ans, solve(i + 1, false));
    }
  }
  cout << ans << '\n';
  return 0;
}
