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 int N = 3e5 + 5;
const int M = 1e9 + 7;
const int M1 = 2e9 + 14;
const int INF = 2e9 + 5;
const int rx[8] = {-1, 0, 1, 0, 1, 1, -1, -1};
const int ry[8] = {0, -1, 0, 1, 1, -1, 1, -1};
mt19937 gen(time(0));
long long bp(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2)
    return a * bp(a, b - 1) % M;
  else
    return bp(a * a % M, b / 2) % M;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int ka = 0;
  vector<int> a;
  for (auto i : s) {
    if (i != 'a' && i != 'b') continue;
    if (i == 'a') {
      ka++;
    } else {
      if (ka) {
        a.push_back(ka);
        ka = 0;
      }
    }
  }
  a.push_back(ka);
  long long x = 1;
  long long res = 0;
  for (int i = 0; i < a.size(); i++) {
    x *= a[i] + 1;
    x %= M;
  }
  cout << x - 1;
  return 0;
}
