Problem: We have N lamps numbered 1 to N, and N buttons numbered 1 to N. Initially, Lamp 1, 2, \cdots, A are on, and the other lamps are off.

Snuke and Ringo will play the following game.

* First, Ringo generates a permutation (p_1,p_2,\cdots,p_N) of (1,2,\cdots,N). The permutation is chosen from all N! possible permutations with equal probability, without being informed to Snuke.

* Then, Snuke does the following operation any number of times he likes:

* Choose a lamp that is on at the moment. (The operation cannot be done if there is no such lamp.) Let Lamp i be the chosen lamp. Press Button i, which switches the state of Lamp p_i. That is, Lamp p_i will be turned off if it is on, and vice versa.



At every moment, Snuke knows which lamps are on. Snuke wins if all the lamps are on, and he will surrender when it turns out that he cannot win. What is the probability of winning when Snuke plays optimally?

Let w be the probability of winning. Then, w \times N! will be an integer. Compute w \times N! modulo (10^9+7).

Constraints

* 2 \leq N \leq 10^7
* 1 \leq A \leq \min(N-1,5000)

Input

Input is given from Standard Input in the following format:


N A


Output

Print w \times N! modulo (10^9+7), where w is the probability of Snuke's winning.

Examples

Input

3 1


Output

2


Input

3 2


Output

3


Input

8 4


Output

16776


Input

9999999 4999


Output

90395416

Solution (in CPP):

Solution:
#include<cstdio>
const int mod=1000000007;
int N,A,f[5010][5010][2],fac[10000010],ifac[10000010];
long long C(int n,int m){return m<0||m>n?0:1ll*fac[n]*ifac[m]%mod*ifac[n-m]%mod;}
long long inv(int a,int p=mod){return a==1?1:(1+p*(a-inv(p%a,a)))/a%p;}
int main(){
	scanf("%d%d",&N,&A);
	for(int i=*fac=1;i<=N;i++)fac[i]=1ll*fac[i-1]*i%mod;
	ifac[N]=inv(fac[N]);
	for(int i=N;i;i--)ifac[i-1]=1ll*ifac[i]*i%mod;
	for(int i=A;i>=0;i--){
		for(int j=i;j>=0;j--){
			f[i][j][0]=(C(N-A+i-j-1,i-1)*(i<A?fac[A-i-1]:1)+f[i+1][j+1][0]+f[i+1][j][1]*(A-i-1ll))%mod;
			f[i][j][1]=(f[i+1][j][0]+f[i+1][j][1]*(A-i-1ll))%mod;
		}
	}
	int s=***f*1ll*fac[N-A]%mod;
	printf("%d\n",s);
}