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;

#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)

typedef long long ll;

const int N=2333,NN=5e6;
const ll p=1e9+7;

int n,k;
ll jc[NN+3],njc[NN+3],f[N][N],g[N][N];

ll ksm(ll x,ll w){
	ll ans=1;
	while(w){
		if(w&1ll) (ans*=x)%=p;
		(x*=x)%=p;
		w>>=1;
	}
	return ans;
}

ll C(ll a,ll b){
	return (jc[a]*njc[b]%p)*njc[a-b]%p;
}

int main(){
	scanf("%d%d",&n,&k);

	if(k==1){
		printf("1\n");
		return 0;
	} 

	jc[0]=njc[0]=1;int L=5e6;
	rep(i,1,L) jc[i]=(jc[i-1]*i)%p;
	rep(i,1,L) njc[i]=ksm(jc[i],p-2);

	rep(j,1,n) g[n][j]=1;f[n][n]=1;
	per(i,n-1,1){
		rep(j,i,n)
			f[i][j]=(g[i+1][j]*C(n-j+(n-i+1)*(k-1)-1,k-2))%p;
		per(j,n,1) g[i][j]=(g[i][j+1]+f[i][j])%p;
	} 

	ll ans=0;
	rep(i,1,n) (ans+=f[1][i])%=p;
	(ans*=jc[n])%=p;

	printf("%lld\n",ans);

	return 0;
}