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;
istream& in = cin;
string s;
long long mod = 1e9 + 7;
void input() { in >> s; }
int main() {
  int TEST_CASE = 1;
  while (TEST_CASE-- > 0) {
    input();
    vector<long long> vi;
    int num = 0;
    for (char c : s) {
      if (c == 'a') {
        num++;
      } else if (c == 'b') {
        if (num) {
          vi.push_back(num);
          num = 0;
        }
      } else {
      }
    }
    if (num) {
      vi.push_back(num);
      num = 0;
    }
    if (vi.empty()) {
      cout << 0 << endl;
    } else {
      long long ans = 1;
      for (long long k : vi) {
        ans = ans * (k + 1) % mod;
      }
      ans = (ans + mod - 1) % mod;
      cout << ans << endl;
    }
  }
  return 0;
}
