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;
long long MOD = 1e9 + 7;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  string t;
  cin >> s;
  for (int i = 0; i < s.size();) {
    if (s[i] == 'a') {
      t += s[i];
      i++;
    } else if (s[i] == 'b') {
      t += s[i];
      while (s[i] == 'b') {
        i++;
      }
    } else {
      i++;
    }
  }
  vector<int> a;
  int cnt = 0;
  for (int i = 0; i < t.size(); i++) {
    if (t[i] == 'a') {
      cnt++;
    } else if (t[i] == 'b') {
      if (cnt) a.push_back(cnt);
      cnt = 0;
    }
    if ((i == (t.size() - 1)) and (t[i] == 'a')) {
      a.push_back(cnt);
    }
  }
  if (a.size() == 0) {
    cout << 0 << endl;
    return 0;
  }
  long long ans = 1;
  for (auto x : a) {
    ans = (ans * (x + 1)) % MOD;
  }
  cout << ans - 1 << endl;
  return 0;
}
