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;
long long dp[200005];
long long mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
  s = " " + s;
  long long flag = 0;
  long long check = 0;
  for (long long i = 1; i < s.size(); i++) {
    if (s[i] == 'a') {
      dp[i] = (dp[i - 1] + 1 + flag) % mod;
      check = 1;
    } else if (s[i] == 'b') {
      if (check == 1) {
        flag = dp[i - 1];
      }
      dp[i] = dp[i - 1] % mod;
    } else {
      dp[i] = dp[i - 1] % mod;
    }
  }
  cout << dp[s.size() - 1];
}
