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 inf = (int)1e9;
const int mod = inf + 7;
int n;
string second;
long long dp[100300], lst[100300], p[100300];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> second;
  n = (int)second.size();
  lst[0] = -1;
  if (second[0] == 'b') lst[0] = 0;
  for (int i = 1; i < n; ++i) {
    if (second[i] == 'b')
      lst[i] = i;
    else
      lst[i] = lst[i - 1];
  }
  if (second[0] == 'a') dp[0] = 1;
  p[0] = dp[0];
  for (int i = 1; i < n; ++i) {
    int j = lst[i];
    p[i] = p[i - 1];
    if (second[i] != 'a') continue;
    if (j == -1) {
      dp[i] = 1;
      p[i] = (p[i] + dp[i]) % mod;
      continue;
    }
    dp[i] = p[j] + 1;
    p[i] = (p[i] + dp[i]) % mod;
  }
  cout << p[n - 1] << "\n";
  return 0;
}
