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 + 100;
const int mod = 1e9 + 7;
char str[maxn];
string s;
vector<int> vec;
int main() {
  scanf("%s", str);
  int n = strlen(str);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] == 'a') {
      cnt++;
      s += str[i];
    } else if (str[i] == 'b') {
      s += str[i];
      vec.push_back(cnt);
      cnt = 0;
    }
  }
  if (cnt != 0) vec.push_back(cnt);
  n = s.size();
  if (vec.size() == 0) {
    printf("0");
    return 0;
  }
  int ans = 0;
  ans = vec[0];
  for (int i = 1; i < vec.size(); i++) {
    ans = ((((ans + 1) % mod) * (vec[i] % mod)) % mod + ans) % mod;
  }
  printf("%d", ans);
  return 0;
}
