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;
char s[100005];
int main() {
  cin >> s;
  int sl = strlen(s);
  long long ans = 0, now = 0;
  for (int i = 0; i < sl; i++) {
    if (s[i] == 'a') {
      ans += now + 1;
      ans %= 1000000007;
    } else if (s[i] == 'b') {
      now = ans;
    }
  }
  cout << ans << endl;
  return 0;
}
