P3266 [JLOI2015] Are You Kidding Me

Description

Speaking of which, after graduation, B has only met R twice. R has an $n \times m$ array $x_{i,j}$. For $1 \le i \le n, 1 \le j \le m$, it holds that $0 \le x_{i,j} \le m$. Find the number of possible arrays $x_{i,j}$. B thinks the constraints are too loose and additionally requires that for $1 \le i \le n, 1 \le j < m$, we have $x_{i,j} < x_{i,j+1}$; and for $1 < i \le n, 1 \le j < m$, we have $x_{i,j} < x_{i-1,j+1}$. B believes R can just pwn this problem. R says: "This trolling is way too realistic =.=, at least take the answer modulo $10^9+7$." B thinks R makes sense, so he asks you to compute the answer modulo $10^9+7$.

Input Format

A single line with two integers $n, m$, as described above.

Output Format

A single line with a single number: the count of arrays $x_{i,j}$ that satisfy both B's and R's conditions, modulo $10^9+7$.

Explanation/Hint

For $100\%$ of the testdata, $1 \le n, m \le 10^6$. Translated by ChatGPT 5