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;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
void mad(long long int &a, long long int b) {
  a = (a + b) % 1000000007;
  if (a < 0) a += 1000000007;
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
vector<long long int> printDivisors(int n) {
  vector<long long int> v;
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i) {
        v.push_back(i);
      } else {
        v.push_back(n / i);
        v.push_back(i);
      }
    }
  }
  return v;
}
bool check(long long int i, long long int j, long long int n, long long int m) {
  if (i < 0 || j < 0 || i > n - 1 || j > m - 1) {
    return false;
  }
  return true;
}
bool prime[1000001];
void SieveOfEratosthenes(int n) {
  memset(prime, true, sizeof(prime));
  map<long long int, long long int> mp;
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  prime[1] = false;
  prime[0] = false;
}
map<long long int, long long int> primeFactors(long long int n) {
  map<long long int, long long int> mp;
  while (n % 2 == 0) {
    mp[2]++;
    n = n / 2;
  }
  for (long long int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      mp[i]++;
      n = n / i;
    }
  }
  if (n > 2) {
    mp[n]++;
  }
  return mp;
}
long long int arr[200001];
void solve() {
  string s;
  cin >> s;
  long long int count = 0;
  long long int n = s.length();
  long long int counta = 0, countb = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'a') {
      counta = (counta + countb + 1) % 1000000007;
    }
    if (s[i] == 'b') {
      countb = counta;
    }
  }
  cout << counta << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
