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 gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<long long int> adj[100001];
long long int vist[100001], x[100001], y[100001], n, ans = -1;
void dfs(long long int i) {
  vist[i] = 1;
  for (int j = 1; j < n + 1; j++)
    if (!vist[j])
      if (x[i] == x[j] || y[i] == y[j]) dfs(j);
}
long long int fact(long long int n) {
  if (n == 1) return 1;
  return (n % 1000000007 * fact(n - 1) % 1000000007) % 1000000007;
}
long long int combi(long long int n) {
  long long int ans = 0;
  for (int i = 1; i < n + 1; i++) {
    ans += (fact(n) / fact(i)) % 1000000007;
    ans % 1000000007;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  vector<long long int> d;
  long long int a = 0, c = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'a') a++;
  }
  long long int a1 = 0;
  bool ok = false;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'b' && i > 0) {
      if (s[i - 1] == 'a' || ok) {
        ok = true;
      } else {
        if (a1 > 0) d.push_back(a1);
        a1 = 0;
        ok = false;
      }
    }
    if (ok && s[i] == 'a') a1++;
    if (s[i] != 'a' && s[i] != 'b') {
      ok = false;
      if (a1 > 0) d.push_back(a1);
      a1 = 0;
    }
  }
  if (a1 > 0) d.push_back(a1);
  long long int ans = a;
  if (d.size() != 0) {
    for (int i = 0; i < d.size(); i++) {
      ans = (ans % 1000000007 + (d[i] % 1000000007)) % 1000000007;
    }
  }
  cout << ans << endl;
  return 0;
}
