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 fact(long long int n) {
  if (n == 1 || n == 0) return 1;
  return n * fact(n - 1);
}
long long int isPrime(long long int n) {
  if (n < 2) return 0;
  if (n < 4) return 1;
  if (n % 2 == 0 or n % 3 == 0) return 0;
  for (long long int i = 5; i * i <= n; i += 6)
    if (n % i == 0 or n % (i + 2) == 0) return 0;
  return 1;
}
long long int modexpo(long long int x, long long int p) {
  long long int res = 1;
  x = x % 1000000007;
  while (p) {
    if (p % 2) res = res * x;
    p >>= 1;
    x = x * x % 1000000007;
    res %= 1000000007;
  }
  return res;
}
long long int binSearch(long long int a[], long long int l, long long int h,
                        long long int x) {
  long long int c = -1;
  while (l <= h) {
    long long int m = (l + h) / 2;
    if (a[m] >= x) {
      c = m;
      h = m - 1;
    } else
      l = m + 1;
  }
  return c;
}
void pairsort(long long int a[], long long int b[], long long int n) {
  pair<long long int, long long int> pairt[n];
  for (long long int i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (long long int i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long int nod(long long int n) {
  long long int c = 0;
  while (n > 0) {
    c++;
    n /= 10;
  }
  return c;
}
long long int sod(long long int n) {
  long long int s = 0;
  while (n > 0) {
    s += n % 10;
    n /= 10;
  }
  return s;
}
long long int mulmod(long long int a, long long int b) {
  long long int res = 0;
  a = a % 1000000007;
  while (b > 0) {
    if (b % 2 == 1) res = (res + a) % 1000000007;
    a = (a * 2) % 1000000007;
    b /= 2;
  }
  return res % 1000000007;
}
string intToString(long long int n) {
  string s = "";
  while (n > 0) {
    s += char(n % 10 + '0');
    n /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int q, n, m, k = 1, i, j, f = 0, g = 0, h = 1, sum = 0, ans = 0, x,
                         y, l, prev;
  string s;
  cin >> s;
  n = s.length();
  long long int a[n], summ[n];
  for (i = 0; i < n; i++) {
    if (s[i] == 'a') {
      if (!g) {
        a[g] = 1;
        summ[g] = 1;
        g++;
        f = 0;
        continue;
      }
      if (!f) {
        a[g] = a[g - 1];
        summ[g] = summ[g - 1] + a[g];
        g++;
      } else {
        a[g] = summ[g - 1] + 1;
        summ[g] = summ[g - 1] + a[g];
        g++;
      }
      a[g] %= 1000000007;
      summ[g] %= 1000000007;
      f = 0;
    }
    if (s[i] == 'b') f = 1;
  }
  if (g)
    cout << summ[g - 1];
  else
    cout << 0;
  return 0;
}
