#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
std::pair<T, U> operator+(const std::pair<T, U> &l, const std::pair<T, U> &r) {
  return {l.first + r.first, l.second + r.second};
}
typedef void (*callback_function)(void);
const long long INF64 = 1e18;
const long long INF32 = 1e9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  {
    long long MOD = 1e9 + 7;
    string s;
    cin >> s;
    s += 'b';
    long long cnt = 0;
    vector<long long> a;
    for (char &ch : s) {
      if (ch == 'a')
        cnt++;
      else if (ch == 'b' && cnt)
        a.push_back(cnt), cnt = 0;
    }
    long long ans = 1;
    for (long long &i : a) ans = (ans * (i + 1)) % MOD;
    ans = (ans + MOD - 1) % MOD;
    cout << ans << endl;
  }
  return 0;
}
