#P1641. [SCOI2010] 生成字符串
[SCOI2010] 生成字符串
Description
lxhgww recently received a task to generate a string. The task requires him to use copies of and copies of to form a string, and it also requires that in any first characters, the number of is not less than the number of . Now lxhgww wants to know how many strings satisfy the requirement. Can you help him? The answer is taken modulo .
Input Format
The input contains a single line with integers and .
Output Format
Output a single line with integer, the number of strings that satisfy the requirement. The answer is taken modulo .
2 2
2
Hint
For of the testdata, it is guaranteed that . For of the testdata, it is guaranteed that .
Translated by ChatGPT 5
京公网安备 11011102002149号