题目描述
Given is a string $S$. From this string, Takahashi will make a new string $T$ as follows.
- First, mark one or more characters in $S$. Here, no two marked characters should be adjacent.
- Next, delete all unmarked characters.
- Finally, let $T$ be the remaining string. Here, it is forbidden to change the order of the characters.
How many strings are there that can be obtained as $T$? Find the count modulo $(10^9 + 7)$.
输入格式
Input is given from Standard Input in the following format:
>$S$
#### Constraints
- $S$ is a string of length between $1$ and $2 \times 10^5$ (inclusive) consisting of lowercase English letters.
输出格式
Print the number of different strings that can be obtained as $T$, modulo $(10^9 + 7)$.
样例输入 #1
abc
样例输出 #1
4
样例输入 #2
aa
样例输出 #2
1
样例输入 #3
acba
样例输出 #3
6
样例输入 #4
chokudai
样例输出 #4
54
提示
***For Sample #1:***
There are four strings that can be obtained as $T$: `a`, `b`, `c`, and `ac`.
Marking the first character of $S$ yields `a`;
marking the second character of $S$ yields `b`;
marking the third character of $S$ yields `c`;
marking the first and third characters of $S$ yields `ac`.
Note that it is forbidden to, for example, mark both the first and second characters.
***For Sample #2:***
There is just one string that can be obtained as $T$, which is `a`. Note that marking different positions may result in the same string.
***For Sample #3:***
There are six strings that can be obtained as $T$: `a`, `b`, `c`, `aa`, `ab`, and `ca`.
来源
AtCoder [ABC214F]