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;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << endl;
  err(++it, args...);
}
const long long int nax = 1e5 + 5;
void solve() {
  string s;
  cin >> s;
  string s1 = "";
  long long int n = (long long int)s.size(), ct = 0, m;
  vector<long long int> b;
  for (long long int i = 0; i < n; i++)
    if (s[i] == 'a' || s[i] == 'b') {
      s1 += s[i];
    }
  for (long long int i = 0; i < (long long int)s1.size(); i++) {
    if (s1[i] == 'a')
      ct++;
    else {
      while (i < (long long int)s1.size() && s1[i] != 'a') i++;
      i--;
      b.push_back(ct), ct = 0;
    }
  }
  if (ct) b.push_back(ct);
  ct = 0, m = 1e9 + 7;
  for (long long int i = 0; i < (long long int)b.size() - 1; i++) {
    ct = (ct + ((b[i] + 1) * (b[i + 1] + 1)) % m) % m;
  }
  ct = (ct - 1 + m) % m;
  if ((long long int)b.size() == 1)
    cout << b[0];
  else
    cout << ct;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) solve();
  return 0;
}
