Goodeat gets a matrix of N * N. We use (x,y) to denote the entry in the x-th row and the y-th column (

).
Now Goodeat wants to choose C entries, and the following conditions must be met:
1. In each row, at least one entry is chosen
2.
In each column, at least one entry is chosen 3. On the diagonal line (that is, all the entries satisfying x=y),
at least one entry is chosen 4. On the negative diagonal (that is, all the
entries satisfying x+y=N+1),
at least one entry is chosen There are K entries that can’t be chosen.
Now Goodeat wants to know about the number of ways for choosing entries. Since the number may be too large, you only need to output the answer modulo 10007.