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 s;
  cin >> s;
  long long prev = 1;
  long long prevsum = 0;
  long long sum = 0;
  bool b = false;
  bool b1 = false;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a') {
      b1 = true;
      if (b) {
        sum = sum + prevsum + 1;
        prev = prevsum + 1;
        prevsum = prevsum + prev;
      } else {
        sum = sum + prev;
        prevsum = prevsum + prev;
      }
      b = false;
    } else if (s[i] == 'b' && b1) {
      b = true;
    } else {
    }
    sum = sum % 10000000007;
    prevsum = prevsum % 10000000007;
    prev = prev % 10000000007;
  }
  cout << sum;
  return 0;
}
