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 maxn = 100 + 10;
const double EPS = 1e-10;
const long long p = 1e7 + 9;
const long long mod = 1e9 + 7;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline int read() {
  int ret = 0, f = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') f ^= ch == '-', ch = getchar();
  while (ch <= '9' && ch >= '0') ret = ret * 10 + ch - '0', ch = getchar();
  return f ? -ret : ret;
}
string s;
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  long long r = 0, t = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'b') r = t;
    if (s[i] == 'a') t = (r + t + 1) % mod;
  }
  cout << t << endl;
  return 0;
}
