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;
int main() {
  string str;
  cin >> str;
  string str1;
  long long j = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == 'a') {
      str1 += str[i];
      j++;
    } else if (str[i] == 'b') {
      if (j == 0) {
        continue;
      } else {
        if (str1[j - 1] == 'b')
          continue;
        else {
          str1 += str[i];
          j++;
        }
      }
    }
  }
  j = 0;
  long long na = 0;
  vector<long long> numa;
  for (int i = 0; i < str1.size(); i++) {
    if (str1[i] == 'a')
      na++;
    else {
      numa.push_back(na);
      na = 0;
    }
  }
  if (na != 0) numa.push_back(na);
  long long mul, sum = 0;
  if (numa.size() != 0) sum = numa[0];
  for (int i = 1; i < numa.size(); i++) {
    mul = (sum % 1000000007 * numa[i] % 1000000007) % 1000000007;
    sum = (sum % 1000000007 + mul % 1000000007 + numa[i] % 1000000007) %
          1000000007;
  }
  cout << sum;
}
