No.1702 count good string
Problem Statement
You are given a string $S$ of length $N$ consisting of lowercase English letters and ?.
$S$ has $2^{N}-1$ non-empty subsequences. Among them, we define a good subsequence as one that satisfies either of the following conditions.
Conditions
The subsequence does not contain
?The subsequence contains exactly one
?
Here, let $T$ be the set of strings obtained by choosing at most one character of the string yukicoder and replacing it with ?.
Find the number of good subsequences that are contained in $T$, modulo $10^9+7$.
Input
$N$ $S$
The first line contains an integer $N$.
The second line contains a string $S$.
Constraints
$1≤N≤10^5$
$N$ is an integer.
$|S|=N$
$S$ consists of lowercase English letters or
?.
Output
Print the answer on one line.
Print a newline at the end.
Sample
Sample 1
Input
9 yukicoder
Output
1
Sample 2
Input
7 harurun
Output
0
Sample 3
Input
14 yukiyuki?coder
Output
14
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
harurun