#include <bits/stdc++.h>
using namespace std;
void OJ() {}
template <typename T>
bool is_sorted(T a[], long long n) {
  if (n == 1) return true;
  for (long long i = 1; i < n; i++)
    if (a[i] < a[i - 1]) return false;
  return true;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a * b) / (gcd(a, b)); }
void lego() {
  string s, s1 = "";
  cin >> s;
  long long res = 1, cnt = 0;
  for (long long i = 0; i != s.length(); i++) {
    if (s[i] != 'a' and s[i] != 'b')
      continue;
    else
      s1 += s[i];
  }
  cnt = 0;
  for (long long i = 0; i < s1.length(); i++) {
    if (s1[i] == 'a')
      cnt++;
    else {
      res = ((res % 1000000007) * ((1 + cnt) % 1000000007)) % 1000000007;
      cnt = 0;
    }
  }
  res = ((res % 1000000007) * ((1 + cnt) % 1000000007)) % 1000000007;
  cnt = 0;
  cout << --res << "\n";
  return;
}
signed main() {
  OJ();
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tt = 1;
  if (false) cin >> tt;
  while (tt--) lego();
  return 0;
}
