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;
long long int n;
vector<long long int> vec;
long long int add(long long int _a, long long int _b) {
  _a = (_a + 1000000007) % 1000000007;
  _b = (_b + 1000000007) % 1000000007;
  return (_a + _b) % 1000000007;
}
long long int mul(long long int _a, long long int _b) {
  _a = (_a + 1000000007) % 1000000007;
  _b = (_b + 1000000007) % 1000000007;
  return (_a * _b) % 1000000007;
}
char str[100010];
void input() {
  long long int i, j;
  scanf("%s", str);
  n = strlen(str);
}
void solve() {
  long long int i, j, cnt = 0, ret = 1LL;
  vec.clear();
  for (i = 0; i < n; i++) {
    if (str[i] == 'a') {
      cnt++;
    }
    if (str[i] == 'b') {
      vec.push_back(cnt);
      cnt = 0;
    }
  }
  vec.push_back(cnt);
  for (i = 0; i < vec.size(); i++) {
    ret = mul(ret, vec[i] + 1);
  }
  ret = add(ret, -1);
  printf("%lld", ret);
  puts("");
}
int main() {
  input();
  solve();
}
