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;
template <long long MOD>
struct Mint {
  static constexpr long long mod = MOD;
  long long value;
  Mint() : value(0) {}
  Mint(int64_t v_) : value((int64_t)(v_ % mod)) {
    if (value < 0) value += mod;
  }
  static long long inv(long long a, long long m) {
    a %= m;
    assert(a);
    return a == 1
               ? 1
               : (long long)(m - (long long)(inv(m, a)) * (long long)(m) / a);
  }
  Mint inverse() const {
    Mint res;
    res.value = inv(value, mod);
    return res;
  }
  Mint power(Mint a, long long b) const {
    Mint res = 1;
    while (b > 0) {
      if (b & 1) res *= a;
      a = (a * a);
      b >>= 1;
    }
    return res;
  }
  friend std::istream& operator>>(std::istream& input, Mint& other) {
    input >> other.value;
    return input;
  }
  friend std::ostream& operator<<(std::ostream& out, const Mint& other) {
    out << other.value;
    return out;
  }
  Mint operator-() const { return Mint(-value); }
  Mint operator+() const { return Mint(*this); }
  Mint& operator++() {
    value++;
    if (value == mod) value = 0;
    return *this;
  }
  Mint& operator--() {
    if (value == 0) value = mod;
    value--;
    return *this;
  }
  Mint& operator+=(const Mint& o) {
    value = value + o.value;
    if (value >= mod) value -= mod;
    return *this;
  }
  Mint& operator-=(const Mint& o) {
    value = value - o.value;
    if (value < 0) value += mod;
    return *this;
  }
  Mint& operator*=(const Mint& o) {
    value = (int64_t)((int64_t)(value) * (int64_t)(o.value) % mod);
    return *this;
  }
  Mint& operator/=(const Mint& o) { return *this *= o.inverse(); }
  friend Mint operator++(Mint& a, int32_t) {
    Mint r = a;
    ++a;
    return r;
  }
  friend Mint operator--(Mint& a, int32_t) {
    Mint r = a;
    --a;
    return r;
  }
  friend Mint operator+(const Mint& a, const Mint& b) { return Mint(a) += b; }
  friend Mint operator-(const Mint& a, const Mint& b) { return Mint(a) -= b; }
  friend Mint operator*(const Mint& a, const Mint& b) { return Mint(a) *= b; }
  friend Mint operator/(const Mint& a, const Mint& b) { return Mint(a) /= b; }
  friend bool operator==(const Mint& a, const Mint& b) {
    return a.value == b.value;
  }
  friend bool operator!=(const Mint& a, const Mint& b) {
    return a.value != b.value;
  }
  friend bool operator<(const Mint& a, const Mint& b) {
    return a.value < b.value;
  }
  friend bool operator>(const Mint& a, const Mint& b) {
    return a.value > b.value;
  }
  friend bool operator<=(const Mint& a, const Mint& b) {
    return a.value <= b.value;
  }
  friend bool operator>=(const Mint& a, const Mint& b) {
    return a.value >= b.value;
  }
};
using mint = Mint<(long long)1e9 + 7>;
void solve() {
  string temp;
  cin >> temp;
  mint ans = 1;
  string s = "";
  for (long long i = 0; i < temp.length(); i++) {
    if (temp[i] == 'a' || temp[i] == 'b') s += temp[i];
  }
  for (long long i = 0; i < (long long)s.length(); i++) {
    if (s[i] == 'a') {
      long long st = i;
      while (i < s.length() && s[i] == 'a') i++;
      i--;
      ans *= (1 + i - st + 1);
    }
  }
  cout << ans - 1 << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t = 1;
  while (t--) solve();
}
