aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
int dx[] = {0, -1, 0, 1, -1, 1, -1, 1};
int dy[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int N = 1e5 + 5, oo = 1e9;
const long long mod = 1e9 + 7, MOD2 = 1e9 + 9, p1 = 1000003, p2 = 1000033;
const double pi = acos(-1);
using namespace std;
string s;
int dp[N][2][2];
int add(int a, int b) {
  int ret = (a % mod) + (b % mod);
  return ret % mod;
}
int solve(int idx, int valid, int took) {
  if (idx == (int)(s).size()) return took;
  if (~dp[idx][valid][took]) return dp[idx][valid][took];
  int ans = 0;
  if (s[idx] == 'b')
    ans = add(ans, solve(idx + 1, 1, took));
  else if (s[idx] == 'a') {
    if (valid) ans = add(ans, solve(idx + 1, 0, 1));
    ans = add(ans, solve(idx + 1, valid, took));
  } else
    ans = add(ans, solve(idx + 1, valid, took));
  return dp[idx][valid][took] = ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  memset(dp, -1, sizeof dp);
  cout << solve(0, 1, 0);
  return 0;
}
