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 = (long long)1e9 + 7;
int main() {
  string s, t;
  cin >> s;
  t.push_back('z');
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'a' || s[i] == 'b') t.push_back(s[i]);
  }
  long long dp[(200000)];
  for (int i = 0; i < (200000); i++) dp[i] = 0;
  long long last = -1;
  bool f = true;
  for (int i = 1; i <= t.length(); i++) {
    if (t[i] == 'a') {
      if (last != -1) {
        dp[i] = dp[i - 1] + 1 + dp[last];
      } else {
        dp[i] = dp[i - 1] + 1;
      }
      f = false;
    } else {
      if (!f) {
        last = i - 1;
        f = true;
      }
      dp[i] = dp[i - 1];
    }
    dp[i] %= MOD;
  }
  cout << dp[t.length()] << endl;
}
