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>
using namespace std;

const int N=2010,N2=N*N,mod=1000000007;
typedef long long ll;
int ksm(ll a,int b,int c=1){
	for(;b;b/=2,a=a*a%mod)
		if(b&1)c=c*a%mod;
	return c;
}

int jc[N2],jc2[N2],n,K,f[N][N];

int C(int n,int k){
	if(k<0||n<k)return 0;
	return (ll)jc[n]*jc2[k]%mod*jc2[n-k]%mod;
}

void Init(){
	jc[0]=1;
	for(int i=1;i<N2;++i)jc[i]=(ll)jc[i-1]*i%mod;
	jc2[N2-1]=ksm(jc[N2-1],mod-2);
	for(int i=N2-1;i;--i)jc2[i-1]=(ll)jc2[i]*i%mod;
}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>K;Init();--K;
	if(!K){
		cout<<1<<'\n';
		return 0;
	}
	f[0][0]=1;
	for(int i=1;i<=n;++i)
		for(int j=0;j<=i;++j)f[i][j]=(f[i-1][j]+(ll)f[i][j-1]*C((n-j+1)*K+n-i-1,K-1))%mod;
	cout<<(ll)f[n][n]*jc[n]%mod<<'\n';
	return 0;
}