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 MOD 1000000007
 
using namespace std;
 
typedef long long ll;
 
ll pow_mod(ll x,int k) {
  ll ans=1;
  while (k) {
    if (k&1) ans=ans*x%MOD;
    x=x*x%MOD;
    k>>=1;
  }
  return ans;
}
 
int C[5005][5005],facd[10000005],facv[10000005],inv[5005];
 
void pre(int n,int m) {
  facd[0]=1;
  for(int i=1;i<=n;i++) facd[i]=(ll)facd[i-1]*i%MOD;
  facv[n]=pow_mod(facd[n],MOD-2);
  for(int i=n-1;i>=0;i--) facv[i]=(ll)facv[i+1]*(i+1)%MOD;
  for(int i=0;i<=m;i++) C[i][0]=1;
  for(int i=1;i<=m;i++)
    for(int j=1;j<=i;j++) C[i][j]=(C[i-1][j-1]+C[i-1][j])%MOD;
  inv[1]=1;
  for(int i=2;i<=m;i++) inv[i]=(ll)(MOD-MOD/i)*inv[MOD%i]%MOD;
}
 
ll f[5005][5005];
 
int main() {
  int n,m;
  scanf("%d%d",&n,&m);
  pre(n,m);
  ll v=1;
  for(int i=0;i<=m;i++) {
  	ll t=v*((i)?inv[i]:1)%MOD;
  	for(int j=i+1;j<=m;j++) {
  		f[i][j]=(f[i][j]+t*inv[j])%MOD;
  		f[j][j]=(f[j][j]-t*inv[j]%MOD+MOD)%MOD;
	  } 
    ll s=0;
    for(int j=i;j<=m;j++) {
        if (i) f[i][j]=(f[i][j]-f[i-1][j-1]*inv[j]%MOD+MOD)%MOD;
        f[i][j]=(f[i][j]+s*inv[j])%MOD;
        s=(s+f[i][j])%MOD;
      }
    if (i) v=v*(1LL+inv[i])%MOD;
  } 
  ll ans=0;
  for(int i=0;i<m;i++)
    ans=(ans+f[i][m]*facd[n-i-1]%MOD*facv[m-i-1])%MOD;
  ans=ans*facd[m]%MOD;
  printf("%lld\n",ans);
  return 0;
}