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;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s, ref = "";
  cin >> s;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == 'a' || s[i] == 'b') ref += s[i];
  }
  map<char, vector<long long>> m;
  for (long long i = 0; i < ref.size(); i++) {
    if (ref[i - 1] != ref[i]) {
      m[ref[i]].push_back(1);
    } else
      m[ref[i]].back()++;
  }
  long long ans = 1;
  for (long long i = 0; i < m['a'].size(); i++) {
    ans = (ans * m['a'][i]) % 1000000007;
  }
  if (m['a'].size() > 1) {
    for (long long i = 0; i < m['a'].size(); i++) {
      ans = (ans + m['a'][i]) % 1000000007;
    }
  }
  cout << ans;
}
