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 inf = 1e15;
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
const long long MAXN = 1e6 + 10;
const long long N = 4000 + 10;
const long long MN = 200 + 10;
const long long mod = 1e9 + 7;
long long a[MAXN];
long long dp[MAXN];
long long ck(long long k) {
  while (k >= mod) k -= mod;
  return k;
}
int main() {
  faster();
  string t;
  cin >> t;
  long long cnt = 0;
  vector<long long> v;
  for (int i = 0; i < t.size(); i++) {
    if (t[i] != 'a' && t[i] != 'b')
      continue;
    else {
      if (t[i] == 'b' && cnt > 0) {
        v.push_back(cnt);
        cnt = 0;
      } else if (t[i] == 'a') {
        cnt++;
      }
    }
  }
  if (cnt) {
    v.push_back(cnt);
  }
  long long k = 1;
  for (int i = 0; i < v.size(); i++) {
    k *= v[i] + 1;
    while (k > mod) k -= mod;
  }
  k--;
  cout << k << endl;
}
