aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long mod = 1e9 + 7;
const int inf = 1e9 + 5;
const int N = 3e5 + 5;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int i, n, cnt = 0;
  string second;
  vector<long long> v;
  cin >> second;
  for (auto i : second) {
    if (i == 'a') {
      ++cnt;
    }
    if (i == 'b') {
      v.push_back(cnt);
      cnt = 0;
    }
  }
  v.push_back(cnt);
  long long ans = 1;
  for (auto i : v) {
    ans *= (i + 1);
    ans %= mod;
  }
  cout << ans - 1;
  return 0;
}
