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() {
  string s;
  cin >> s;
  int f = 1;
  s = s + "b";
  long long int ans = 1;
  long long int x = 0;
  for (long long int i = 0; i < s.length(); i++) {
    if (s[i] == 'a') {
      x++;
    }
    if (s[i] == 'b') {
      ans *= (x + 1);
      ans %= 1000000007;
      x = 0;
    }
  }
  ans--;
  ans += 1000000007;
  ans %= 1000000007;
  cout << ans;
}
