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;
using std::string;
int dp[100002];
int main() {
  string s;
  cin >> s;
  int ans = 0, temp = 0;
  for (int i = 0; i < s.size(); i++) {
    if (i == 0) {
      if (s[i] == 'a') {
        dp[i] = 1;
      }
      ans = dp[i];
    } else {
      if (s[i] == 'b') {
        dp[i] = dp[i - 1];
        temp = dp[i];
      } else if (s[i] == 'a') {
        dp[i] = (temp + 1) % 1000000007;
        dp[i] = (dp[i] + dp[i - 1]) % 1000000007;
        ans = dp[i];
      } else {
        dp[i] = dp[i - 1];
      }
    }
  }
  cout << ans;
}
