AtCoder Grand Contest 048
F
01 Record
AtCoder
未评级
原题
← E→
翻译中…

Problem Statement

翻译中…

Snuke received a big blackboard. Being pleased with this present, he first wrote some positive integers. Then, he repeated the following operation until there was no integer written on the blackboard:

翻译中…
  • Choose one integer written on the blackboard and erase it. Let $x$ be the erased integer. Then, record the remainder of $x$ divided by $2$ on his notebook. Finally, if $x \geq 2$, write a new integer $x-1$ on the blackboard.
翻译中…

Snuke's record is represented by a string $S$ consisting of 0 and 1, where $S_i$ is the remainder of the chosen integer divided by $2$ in the $i$-th operation.

翻译中…

Snuke forgot the combination of positive integers he first wrote on the blackboard. From the information given as the string $S$, find the number of possible combinations of positive integers he first wrote on the blackboard. Here, we consider combinations $a$ and $b$ of positive integers different when there is an integer $v$ such that the numbers of times $v$ occurs in $a$ and $v$ occurs in $b$ differ. Since the count can be enormous, compute it modulo $(10^9+7)$. Also, it is possible that Snuke's record is incorrect and that no combination of positive integers satisfies the condition. In such a case, just answer $0$.

翻译中…

Constraints

翻译中…
  • $1 \leq |S| \leq 300$
  • $S$ is a string consisting of 0 and 1.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

S

翻译中…

Output

翻译中…

Print the number of possible combinations of positive integers written on the blackboard, modulo $(10^9+7)$.

翻译中…

样例

Input #1
101
Output #1
2
There are two possible combinations of integers written on the blackboard: $\{1,2\}$ and $\{3\}$.
Input #2
100
Output #2
0
There is no possible combination of integers written on the blackboard.
Input #3
010101
Output #3
3
There are three possible combinations of integers written on the blackboard: $\{2,2,2\}$, $\{2,4\}$, and $\{6\}$.
Input #4
11101000111110111101001011110010111110101111110111
Output #4
3904
题目信息
题号
agc048_f
时间限制
4 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。