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 long long mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 5;
string s;
int main() {
  cin >> s;
  int len = s.length();
  long long ans = 0;
  long long suma = 0;
  int flag = 0;
  int sign = 0;
  long long sumb = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == 'a') {
      sign = 1;
      suma = (suma + 1) % mod;
      if (sumb) ans = (ans + sumb % mod) % mod;
    } else if (s[i] == 'b') {
      sumb++;
    }
  }
  cout << (suma + ans) % mod << endl;
}
