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 M = 1e9 + 7;
long long expo(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long ret = expo(a, b / 2);
    ret = (ret * ret) % 1000000007;
    return ret;
  } else {
    long long ret = expo(a, b / 2);
    ret = (ret * ret) % 1000000007;
    ret = (ret * a) % 1000000007;
    return ret;
  }
}
long long inf = 1e18;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.length();
  vector<pair<char, int> > v;
  int y = 0;
  int a = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == 'a') a++;
  for (int i = 0; i < n; i++) {
    int j;
    for (j = i; j < n; j++) {
      if (s[j] == s[i]) {
        y++;
        if (j == n - 1) v.push_back({s[i], y});
      } else {
        v.push_back({s[i], y});
        y = 0;
        break;
      }
    }
    i = j - 1;
  }
  int t = v.size();
  long long ans = 0, x = 1;
  for (int i = 0; i < t; i++) {
    if (v[i].first == 'a') {
      if (i + 2 < t && v[i + 1].first == 'b' && v[i + 2].first == 'a') {
        x = (x * v[i].second) % 1000000007;
        for (int j = i + 2; j < t; j += 2) {
          if (v[j - 1].first == 'b' && v[j].first == 'a') {
            x = (x * v[j].second) % 1000000007;
          } else {
            break;
          }
        }
        ans = (ans + x) % 1000000007;
        x = 1;
      }
    }
  }
  cout << ans + a;
}
