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() {
  unsigned long long k = 1;
  string st, st2;
  vector<int> myvec;
  myvec.push_back(0);
  st2 = '\0';
  cin >> st;
  for (int i = 0; i < st.size(); i++) {
    if (st[i] != 'a' && st[i] != 'b') {
      continue;
    } else {
      st2 = st2 + st.substr(i, 1);
    }
  }
  for (int i = 0; i < st2.size(); i++) {
    if (st2[i] == 'a') {
      myvec.push_back(1);
      i++;
      while (st2[i] == 'a') {
        myvec[myvec.size() - 1]++;
        i++;
      }
    }
  }
  for (int i = 0; i < myvec.size(); i++) {
    k = (k * (myvec[i] + 1) % 1000000007) % 1000000007;
  }
  cout << k - 1 << endl;
}
