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 n = "abbaa", a;
  int mus = 1, ans = 1;
  for (int i = 0; i < n.size(); i++)
    if (n[i] == 'a' || n[i] == 'b') a += n[i];
  a += 'b';
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == 'a')
      mus++;
    else {
      ans *= mus;
      ans %= 1000000007;
      mus = 1;
    }
  }
  cout << ans - 1;
  return 0;
}
