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 GCD(long long A, long long B) {
  if (B == 0)
    return A;
  else
    return GCD(B, A % B);
}
long long modularExponentiation(long long x, long long n, long long M) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
long long binaryExponentiation(long long x, long long n) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = result * x;
    x = x * x;
    n = n / 2;
  }
  return result;
}
long long modInverse(long long A, long long M) {
  return modularExponentiation(A, M - 2, M);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  string Str, S = "";
  cin >> Str;
  for (long long i = 0; i < Str.length(); i++) {
    if (Str[i] == 'a')
      S += 'a';
    else if (Str[i] == 'b')
      S += 'b';
    else
      continue;
  }
  if (S.length() == 0)
    cout << "0" << endl;
  else {
    long long first, last;
    for (long long i = 0; i < S.length(); i++)
      if (S[i] == 'a') {
        first = i;
        break;
      }
    for (long long i = S.length() - 1; i >= 0; i--)
      if (S[i] == 'a') {
        last = i;
        break;
      }
    long long temp = 0, counta = 1, lasta = first, ans = 0;
    for (long long i = first + 1; i <= last; i++) {
      if (S[i] != 'a')
        continue;
      else {
        if (i - lasta > 1) {
          lasta = i;
          ans += counta;
          ans = (ans) % 1000000007;
          temp = counta;
          counta++;
        } else if (i - lasta == 1) {
          lasta = i;
          ans += temp;
          ans = (ans) % 1000000007;
          counta++;
        }
      }
    }
    for (long long i = 0; i < S.length(); i++) {
      if (S[i] == 'a') ans++;
      ans = (ans + 1000000007) % 1000000007;
    }
    cout << ans << endl;
  }
}
