{"problem":{"name":"Popping Balls","description":{"content":"$A + B$ balls are arranged in a row. The leftmost $A$ balls are colored red, and the rightmost $B$ balls are colored blue. You perform the following operation: *   First, you choose two integers $s, ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"code_festival_2017_qualb_e"},"statements":[{"statement_type":"Markdown","content":"$A + B$ balls are arranged in a row. The leftmost $A$ balls are colored red, and the rightmost $B$ balls are colored blue.\nYou perform the following operation:\n\n*   First, you choose two integers $s, t$ such that $1 \\leq s, t \\leq A + B$.\n*   Then, you repeat the following step $A + B$ times: In each step, you remove the first ball or the $s$\\-th ball (if it exists) or the $t$\\-th ball (if it exists, all indices are 1-based) from left in the row, and give it to Snuke.\n\nIn how many ways can you give the balls to Snuke? Compute the answer modulo $10^9 + 7$.\nHere, we consider two ways to be different if for some $k$, the $k$\\-th ball given to Snuke has different colors. In particular, the choice of $s, t$ doesn't matter. Also, we don't distinguish two balls of the same color.\n\n## Constraints\n\n*   $1 \\leq A, B \\leq 2000$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$A$ $B$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"code_festival_2017_qualb_e","tags":[],"sample_group":[["3 3","20\n\nThere are $20$ ways to give $3$ red balls and $3$ blue balls. It turns out that all of them are possible.\nHere is an example of the operation (`r` stands for red, `b` stands for blue):\n\n*   You choose $s = 3, t = 4$.\n*   Initially, the row looks like `rrrbbb`.\n*   You remove $3$rd ball (`r`) and give it to Snuke. Now the row looks like `rrbbb`.\n*   You remove $4$th ball (`b`) and give it to Snuke. Now the row looks like `rrbb`.\n*   You remove $1$st ball (`r`) and give it to Snuke. Now the row looks like `rbb`.\n*   You remove $3$rd ball (`b`) and give it to Snuke. Now the row looks like `rb`.\n*   You remove $1$st ball (`r`) and give it to Snuke. Now the row looks like `b`.\n*   You remove $1$st ball (`b`) and give it to Snuke. Now the row is empty.\n\nThis way, Snuke receives balls in the order `rbrbrb`."],["4 4","67\n\nThere are $70$ ways to give $4$ red balls and $4$ blue balls. Among them, only `bbrrbrbr`, `brbrbrbr`, and `brrbbrbr` are impossible."],["7 9","7772"],["1987 1789","456315553"]],"created_at":"2026-03-03 11:01:14"}}