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 p = (long long)(1e9 + 7);
int main() {
  ios_base::sync_with_stdio(0);
  string s;
  cin >> s;
  s += 'b';
  int n = (int)s.size();
  long long answer = 0;
  long long cnt = 0;
  bool lol = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') {
      cnt++;
    }
    if (s[i] == 'b') {
      answer += (answer + 1) * cnt;
      answer %= p;
      cnt = 0;
    }
  }
  cout << answer;
  return 0;
}
