#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  long long int ans = 1, prevB = 1;
  int i = 0, length = s.length();
  while (i < length) {
    while (s[i] != 'b' && i < length) {
      if (s[i] == 'a') ans = ((ans % mod) + (prevB % mod)) % mod;
      i++;
    }
    while (s[i] != 'a' && i < length) {
      prevB = ans;
      i++;
    }
  }
  ans--;
  if (ans < 0) ans += mod;
  cout << ans;
}
