#include <bits/stdc++.h>
using namespace std;
long long sub(long long a, long long b) {
  return (a - b + 1000000007) % 1000000007;
}
long long add(long long a, long long b) { return (a + b) % 1000000007; }
long long mul(long long a, long long b) { return (a * b) % 1000000007; }
vector<long long> adj[100005];
bool vis[100005];
long long siz, edges;
void dfs(long long i) {
  vis[i] = 1;
  for (long long j = 0; j < adj[i].size(); j++) {
    edges++;
    if (!vis[adj[i][j]]) dfs(adj[i][j]);
  }
}
long long mpow(long long base, long long exp) {
  base %= 1000000007;
  long long result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((long long)result * base) % 1000000007;
    base = ((long long)base * base) % 1000000007;
    exp >>= 1;
  }
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, sum = 0, t = 1, m, ans;
  while (t--) {
    string s1, s = "";
    cin >> s1;
    for (long long i = 0; i < s1.length(); i++)
      if (s1[i] == 'a' || s1[i] == 'b') s += s1[i];
    n = s.length();
    vector<long long> dp(n + 1, 1);
    dp[0] = 1;
    ans = 1;
    for (long long i = 1; i < n + 1; i++) {
      if (s[i - 1] == 'a')
        dp[i] = dp[i - 1] + 1;
      else {
        dp[i] = 1;
        ans = (ans * (dp[i - 1])) % 1000000007;
      }
    }
    ans = (ans * dp[n]) % 1000000007;
    cout << ans - 1 << '\n';
  }
  cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
  ;
}
