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 mod = 1000000007;
const int maxn = 111111;
char s[maxn];
void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  while (scanf("%s", s) > 0) {
    int len = strlen(s);
    int ans = 0;
    int ca = 0, cb = 0;
    char last = '?';
    for (int i = 0; i < len; i++) {
      if (s[i] != 'a' && s[i] != 'b') continue;
      if (s[i] == 'a')
        add(ans, 1), add(ans, cb), add(ca, cb + 1);
      else {
        if (last == 'a' && s[i] == 'b') add(cb, ca);
      }
      last = s[i];
    }
    cout << ans << endl;
  }
  return 0;
}
