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;
void debug_out() { cerr << endl; }
void clock_out() {
  cerr << "\nTime Elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " s\n";
}
void fileio() {
  freopen("/home/dwai/Desktop/cp/input.txt", "r", stdin);
  freopen("/home/dwai/Desktop/cp/output.txt", "w", stdout);
  freopen("/home/dwai/Desktop/cp/debug.txt", "w", stderr);
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
int IT_MAX = 1 << 20;
const long long MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
int main() {
  42;
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  string second;
  cin >> second;
  string s = "";
  for (char c : second)
    if (c == 'a' || c == 'b') s += c;
  long long l = s.length();
  long long ans = 1;
  long long c = 0, i;
  for (i = 0; i <= l - 1; i++) {
    if (s[i] == 'a')
      c++;
    else {
      c = 0;
      ans = (ans * (c + 1)) % MOD;
    }
  }
  ans = (ans * (c + 1)) % MOD;
  ans--;
  cout << ans;
  return 0;
}
