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 SIZE 5005
#define MX 10000005
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

ll inv[MX],fac[MX],finv[MX];
ll dp[SIZE][SIZE];
ll naive[SIZE][SIZE];
ll dp2[SIZE];
ll rt[SIZE];

void make()
{
	inv[1]=1;
	fac[0]=fac[1]=1;
	finv[0]=finv[1]=1;
	for(int i=2;i<MX;i++)
	{
		inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
		fac[i]=fac[i-1]*(ll) i%MOD;
		finv[i]=finv[i-1]*inv[i]%MOD;
	}
	rt[0]=1;
	for(int i=1;i<SIZE;i++) rt[i]=rt[i-1]*2LL%MOD;
}
ll C(int a,int b)
{
	if(a<b) return 0;
	return fac[a]*(finv[b]*finv[a-b]%MOD)%MOD;
}
int main()
{
	make();
	int n,A;
	scanf("%d %d",&n,&A);
	for(int i=0;i<=A;i++)
	{
		dp2[i]=1;
		for(int j=2;j<=i;j++)
		{
			dp2[i]-=inv[i];
			if(dp2[i]<0) dp2[i]+=MOD;
		}
	}
	int B=n-A;
	dp[0][0]=1;
	ll ret=0;
	for(int i=0;i<=A;i++)
	{
		ll sum=0;
		for(int j=0;j<=A;j++)
		{
			if(i>0||j>0)
			{
				ll now=sum;
				if(i>0&&j>0)
				{
					now+=dp[i-1][j-1]*inv[A-j+1]%MOD;
					if(now>=MOD) now-=MOD;
				}
				dp[i][j]=now;
				if(j>0)
				{
					sum+=dp[i][j-1]*inv[A-j+1]%MOD;
					if(sum>=MOD) sum-=MOD;
				}
				if(dp[i][j]>0&&i<=B)
				{
					ret+=C(B+j-i-1,j-1)*dp[i][j]%MOD*dp2[A-j]%MOD;
					if(ret>=MOD) ret-=MOD;
				}
			}
		}
	}
	printf("%lld\n",ret*fac[A]%MOD*fac[B]%MOD);
	/*
	ll ret2=0;
	naive[A][B]=fac[A]*fac[B]%MOD;
	for(int i=A;i>=0;i--)
	{
		for(int j=B;j>=0;j--)
		{
			for(int k=1;k<=i;k++)
			{
				for(int l=0;l<=j;l++)
				{
					if(k+l==1) continue;
					ll vl=naive[i][j]*C(k+l-1,k-1)%MOD*inv[i]%MOD;
					naive[i-k][j-l]+=vl;
					if(naive[i-k][j-l]>=MOD) naive[i-k][j-l]-=MOD;
				}
			}
		}
	}
	for(int i=0;i<=A;i++)
	{
		ret2+=naive[i][0]*dp2[i]%MOD;
		if(ret2>=MOD) ret2-=MOD;
	}
	printf("%lld\n",ret2);*/
}