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<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=10000005,M=5005,inf=0x3f3f3f3f,p=1000000007;
int read(){
	int f=1,g=0;
	char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') f=-1;
	for (;isdigit(ch);ch=getchar()) g=g*10+ch-'0';
	return f*g;
}
int qpow (int x,int k){
	int t=1;
	for (;k;k>>=1){
		if (k&1) t=(ll)t*x%p;
		x=(ll)x*x%p;
	}
	return t;
}
int n,m,fac[N],ifac[N],s[M][M],sum[M],f[M][M],g[M],ans;
void check(int &x,int y){if((x+=y)>=p) x-=p;}
int C(int n,int m){return (n<m) ? 0 : (ll)fac[n]*ifac[m]%p*ifac[n-m]%p;}
int P(int n,int m){return (n<m) ? 0 : (ll)fac[n]*ifac[n-m]%p;}
int main(){
//	freopen("a.in","r",stdin);
	n=read();m=read();
	fac[0]=1;
	for (int i=1;i<=n;i++) fac[i]=(ll)fac[i-1]*i%p;
	ifac[n]=qpow(fac[n],p-2);
	for (int i=n;i;i--) ifac[i-1]=(ll)ifac[i]*i%p;
	s[0][0]=sum[0]=1;
	for(int i=1;i<=m;i++)
	for(int j=1;j<=i;j++)
		s[i][j]=(s[i-1][j-1]+(ll)(i-1)*s[i-1][j])%p,check(sum[i],s[i][j]);

	f[0][0]=1;
	for (int i=0;i<=m;i++)
	for (int j=0;j<=i;j++){
		check(f[i][j],(ll)g[j]*ifac[m-i]%p);
		if (i!=0)
			check(ans,(ll)f[i][j]*P(n-m,j)%p*P(n-m-j+i-1,n-m-j)%p*sum[max(0,m-i-1)]%p);
		if (i!=m){
			check(f[i+1][j+1],f[i][j]);
			if (i!=0) check(g[j],(ll)f[i-1][j]*fac[m-(i-1)-1]%p);
		}
	}
	printf("%d\n",ans);
	return 0;
}