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;
const int maxn = 1e5 + 123, base = 1e9 + 7;
int n, pre[maxn];
long long res = 0, f[maxn];
string s;
void Input() {
  cin >> s;
  n = s.length();
  s = ' ' + s;
  int tg = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == 'b') tg = i;
    pre[i] = tg;
  }
  for (int i = 1; i <= n; i++) {
    f[i] = f[i - 1];
    if (s[i] == 'a') {
      if (pre[i] > 0) f[i] = (f[i] + f[pre[i] - 1]) % base;
      f[i] = (f[i] + 1) % base;
    }
  }
  cout << f[n];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Input();
}
