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>
#define cs const
#define pb push_back
using namespace std;
cs int Mod = 1e9 + 7;
int add(int a, int b){ return a + b >= Mod ? a + b - Mod : a + b; }
int dec(int a, int b){ return a - b < 0 ? a - b + Mod : a - b; }
int mul(int a, int b){ return 1ll * a * b % Mod; }
void Add(int &a, int b){ a = add(a,b); }
void Mul(int &a, int b){ a = mul(a,b); }
void Dec(int &a, int b){ a = dec(a,b); }
cs int N = 1e7 + 50;
int n, A, fc[N], ifc[N], iv[N];
int C(int n, int m){ return mul(fc[n],mul(ifc[n-m],ifc[m])); }
void fc_init(int n){
	fc[0]=fc[1]=ifc[0]=ifc[1]=iv[1]=1;
	for(int i=2;i<=n;i++)fc[i]=mul(fc[i-1],i);
	for(int i=2;i<=n;i++)iv[i]=mul(Mod-Mod/i,iv[Mod%i]);
	for(int i=2;i<=n;i++)ifc[i]=mul(ifc[i-1],iv[i]);
}
int calc(int a, int b, int c){ return mul(fc[a+b+c],mul(a,iv[a+b])); }
int main(){
	scanf("%d%d",&n,&A);
	fc_init(n); int ans=0;
	for(int i=1;i<=A;i++)
	for(int j=1,coe;j<=i;j++){
		coe=C(i,j);if((i-j)&1)coe=dec(0,coe);
		Mul(coe,calc(j,n-A,max(0,A-i-1)));
		Add(ans,coe);
	} cout<<ans; return 0;
}