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;
#pragma GCC optimize("-O2")
template <typename T>
void chkmax(T &x, T y) {
  x = max(x, y);
}
template <typename T>
void chkmin(T &x, T y) {
  x = min(x, y);
}
const int LIM = 1e5 + 5, MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int num[LIM], iter = 1;
  num[0] = -1;
  for (int i = 0; i < LIM; i++) num[i] = 0;
  for (int i = 0; i < (int)s.length(); i++) {
    if (s[i] == 'a')
      num[iter]++;
    else if (s[i] == 'b') {
      if (num[iter] > 0) {
        num[iter + 1] = -1;
        iter += 2;
      }
    }
  }
  long long ans = 1;
  for (int i = 1; num[i] > 0; i += 2) {
    ans = (ans * ((num[i] + 1) % MOD)) % MOD;
  }
  cout << ans - 1;
}
