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;
int main() {
  int mod = 1e9 + 7;
  string S;
  cin >> S;
  bool flag = false;
  long ans = 0;
  long plus = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == 'a') {
      if (flag) {
        ans = (2 * ans + 1) % mod;
      } else {
        ans = ans + 1 + plus;
        ans = ans % mod;
      }
      flag = false;
    } else if (S[i] == 'b') {
      plus = ans;
      flag = true;
    }
  }
  cout << ans;
  return 0;
}
