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;
const long long int MOD = 1000000000 + 7;
const long long int MOD1 = 998244353;
const long long int Val9 = 1000000000;
const long long int Val6 = 1000000;
vector<long long int> vd;
void no_of_divisors(long long int n) {
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i) {
        vd.push_back(i);
      } else {
        vd.push_back(i);
        vd.push_back(n / i);
      }
    }
  }
}
long long int pwr(long long int x, long long int y) {
  long long int r = 1;
  while (y > 0) {
    if (y & 1) r = r * x;
    x *= x;
    y >>= 1;
  }
  return r;
}
long long int pwrm(long long int x, long long int y, long long int m) {
  x %= m;
  long long int r = 1;
  while (y > 0) {
    if (y & 1) r = r * x % m;
    x = x * x % m;
    y >>= 1;
  }
  return r;
}
int isPrime(long long int n) {
  if (n <= 1) return 0;
  if (n <= 3) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return 0;
  return 1;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<long long int> vprime;
vector<long long int> vsqr;
void SieveOfEratosthenes(long long int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long int p = 2; p <= n; p++) {
    if (prime[p]) {
      vprime.push_back(p);
      vsqr.push_back(p * p);
    }
  }
}
bool vis[Val6] = {false};
vector<long long int> v[Val6];
vector<long long int> ans1;
long long int dfs(long long int s) {
  long long int p = v[s].size();
  ans1.push_back(s);
  vis[s] = true;
  for (long long int i = (long long int)0; i < (long long int)v[s].size();
       i++) {
    if (vis[v[s][i]] == false) {
      dfs(v[s][i]);
    }
  }
  return 1;
}
void bfs(vector<long long int> v[], long long int n) {
  queue<long long int> q;
  q.push(n);
  vis[n] = true;
  long long int dist = 0;
  while (!q.empty()) {
    long long int p = q.front();
    q.pop();
    dist++;
    for (long long int i = (long long int)0; i < (long long int)v[p].size();
         i++) {
      if (vis[v[p][i]] == false) {
        q.push(v[p][i]);
        vis[v[p][i]] = true;
      }
    }
  }
}
long long int nCr(long long int n, long long int r) {
  long long int ans = 1;
  for (long long int i = (long long int)0; i < (long long int)r; i++) {
    ans *= n - i;
    ans /= i + 1;
  }
  return ans;
}
long long int n;
long long int a[Val6], b[Val6];
vector<long long int> ans;
unsigned long long power(unsigned long long x, int y, int p) {
  unsigned long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
unsigned long long modInverse(unsigned long long n, int p) {
  return power(n, p - 2, p);
}
unsigned long long nCrModPFermat(unsigned long long n, int r, int p) {
  if (r == 0) return 1;
  unsigned long long fac[n + 1];
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  {
    string s;
    cin >> s;
    long long int n = s.size();
    vector<long long int> v;
    long long int c = 0, o = 0;
    for (long long int i = (long long int)0; i < (long long int)n; i++) {
      if (s[i] == 'a') {
        c++;
        o++;
      } else if (s[i] == 'b') {
        if (c != 0) v.push_back(c);
        c = 0;
      } else {
        c = 0;
      }
    }
    if (c != 0) v.push_back(c);
    long long int ans = 0;
    for (long long int i = (long long int)0; i < (long long int)v.size() - 1;
         i++) {
      for (long long int j = (long long int)i + 1; j < (long long int)v.size();
           j++) {
        long long int x = v[i], y = v[j];
        ans = (ans + nCrModPFermat(x, 1, MOD) * nCrModPFermat(y, 1, MOD)) % MOD;
      }
    }
    ans = (ans + (o % MOD)) % MOD;
    cout << ans << "\n";
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}
