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, cnt;
string s, t;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != 'a' && s[i] != 'b') continue;
    t += s[i];
  }
  int flag = 0;
  for (int i = 0; i < t.size(); i++) {
    if (s[i] == 'b')
      ans += cnt, ans %= MD, cnt = 0;
    else {
      cnt += ans + 1;
      cnt %= MD;
    }
  }
  ans += cnt;
  ans %= MD;
  cout << ans << endl;
}
