Problem: Snuke loves colorful balls. He has a total of N×K balls, K in each of his favorite N colors. The colors are numbered 1 through N.

He will arrange all of the balls in a row from left to right, in arbitrary order. Then, for each of the N colors, he will paint the leftmost ball of that color into color 0, a color different from any of the N original colors.

After painting, how many sequences of the colors of the balls are possible? Find this number modulo 10^9+7.

Constraints

* 1≤N,K≤2,000

Input

The input is given from Standard Input in the following format:


N K


Output

Print the number of the possible sequences of the colors of the balls after painting, modulo 10^9+7.

Examples

Input

2 2


Output

4


Input

3 1


Output

1


Input

2 3


Output

14


Input

2000 2000


Output

546381702

Solution (in CPP):

Solution:
#include<bits/stdc++.h> 
#define fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
typedef long long ll;
using namespace std;
const int maxn=2e3+5,mo=1e9+7;
int i,j,n,k,f[maxn][maxn],ji[maxn*maxn],ni[maxn*maxn];
int qs(int x,int y){
	int s=1;
	for(;y;y>>=1,x=(ll)x*x%mo) if(y&1) s=(ll)s*x%mo;
	return s; 
}
int calc(int n,int  m){
	return (ll)ji[n]*ni[m]%mo*ni[n-m]%mo;
}
void mod(int &x){
	x-=(x>=mo)?mo:0;
}
int main(){
	scanf("%d%d",&n,&k);
	if (k==1){
        printf("1\n");
        return 0;
    }
	ji[0]=1;
	fo(i,1,n*k) ji[i]=(ll)ji[i-1]*i%mo;
	ni[n*k]=qs(ji[n*k],mo-2);
	fd(i,n*k,1) ni[i-1]=(ll)ni[i]*i%mo;
	f[0][0]=1;
	fo(i,0,n){
		fd(j,i,0) if (f[i][j]){
			int s=f[i][j];
			if (j) mod(f[i][j-1]+=s);
			if (i<n) mod(f[i+1][j+1]+=(ll)s*calc(i*k-j+k-2,k-2)%mo);
		}
	}
	printf("%d\n",(ll)f[n][0]*ji[n]%mo);
}