You are given a string s of length n where s[i] is either:
A permutation perm of n + 1 integers of all the integers in the range [0, n] is called a valid permutation if for all valid i:
Return the number of valid permutations perm. Since the answer may be large, return it modulo 109 + 7.
You are given a string s of length n where s[i] is either:
A permutation perm of n + 1 integers of all the integers in the range [0, n] is called a valid permutation if for all valid i:
Return the number of valid permutations perm. Since the answer may be large, return it modulo 109 + 7.