Count the number of n x m matrices A satisfying the following condition modulo (109+7).
* Ai, j ∈ {0, 1, 2} for all 1 ≤ i ≤ n, 1 ≤ j ≤ m.
* Ai, j ≤ Ai + 1, j for all 1 ≤ i < n, 1 ≤ j ≤ m.
* Ai, j ≤ Ai, j + 1 for all 1 ≤ i ≤ n, 1 ≤ j < m.
The input consists of several test cases and is terminated by end-of-file.
Each test case contains two integers n and m.
For each test case, print an integer which denotes the result.
1 2 2 2 1000 1000
6 20 540949876
* 1 ≤ n, m ≤ 103
* The number of test cases does not exceed 105.

暂无题解