Sparse Domino Tiling

A domino is a 1 × 2 or 2 × 1 Tile. Determine in how many ways exactly N2 dominoes can be placed without overlapping on an (2M ) × (2N ) chessboard, such that every 2 × 2 square contains at least two uncovered unit squares which lie in the same row or column. One possible tiling is shown below: Input A number of inputs (≤ 1000), with space separated integers N, M (1 ≤ M,N ≤ 1000000), each on one line. Output Output one line per input, the answer modulo 10000000007. Sample Input 11 22 Sample Output 4 36