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 MX = 1e5 + 10, MD = 1e9 + 7;
long long n, m, a[MX], ans, tmp, dp[MX], ps[MX];
string s;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  n = s.size();
  int last = -1;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'b') last = i;
    if (s[i] == 'a') {
      if (last == -1)
        dp[i] = 1;
      else
        dp[i] = ps[last] + 1;
      dp[i] %= MD;
    }
    ps[i] = ps[i - 1] + dp[i];
    ps[i] %= MD;
  }
  cout << ps[n - 1] % MD;
}
