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 long long mod = 1e9 + 7;
const int N = 1e5 + 10;
long long dp[N];
string s;
char s1[N];
int main() {
  cin >> s;
  int len = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a')
      s1[++len] = s[i];
    else if (s[i] == 'b' && s1[len] != 'b')
      s1[++len] = s[i];
  }
  long long last = 0;
  for (int i = 1; i <= len; i++) {
    if (s1[i] == 'a')
      dp[i] = (dp[i - 1] + last + 1);
    else {
      dp[i] = dp[i - 1];
      last = dp[i - 1];
    }
    dp[i] %= mod;
  }
  printf("%lld\n", dp[len]);
}
