#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const long long mod = 1e9 + 7;
char s[100010];
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  long long ans = 1, cnt = 1;
  for (int i = 1; i <= len; i++) {
    if (s[i] == 'a')
      cnt++;
    else if (s[i] == 'b') {
      ans = (ans * cnt) % mod;
      cnt = 1;
    }
  }
  ans = (ans * cnt) % mod;
  cout << ans - 1 << endl;
  return 0;
}
