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<stdio.h>
#define rep(i,m) for(long long i=0; i<m; i++)
#define per(i,m) for(long long i=m-1; i>=0; i--)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define ROF(i,n,m) for(long long i=m-1; i>=n; i--)
#define SORT(v,n) do{sort(v,v+n);reverse(v,v+n);}while(0)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const ll MOD = 1000000007;

ll kaikai[11000]={};
ll KAI(ll m)
{
  if(kaikai[m])return kaikai[m];
  if(m<0) return 0;
  if(m==0) return 1;
  kaikai[m]=m*KAI(m-1)%MOD;
  return kaikai[m];
}

ll extGCD(ll a, ll b, ll *x, ll *y) {
    if (b == 0) {
        *x = 1;
        *y = 0;
        return a;
    }
    ll d = extGCD(b, a%b, y, x);
    *y -= a / b * *x;
    return d;
}

 
ll modinv(ll a) {
    ll x, y;
    extGCD(a, MOD, &x, &y);
    return (x % MOD + MOD) % MOD;
}

ll n,a,ans=0,co[5100]={},dp[5005][5005][3]={};

int main()
{
 
  scanf("%lld%lld",&n,&a);
  co[0]=1;
  rep(i,5050)co[i+1]=co[i]*(n-a-1-i)%MOD*modinv(i+1)%MOD;
  dp[a][0][0]=1;
  ROF(i,1,a+1){
    rep(j,a+2){
      rep(k,3){
        if(k==0){
          dp[i-1][j][1]+=dp[i][j][k]*(i-1)%MOD;
          dp[i-1][j][1]%=MOD;
          dp[i][j+1][2]+=dp[i][j][k];
          dp[i][j+1][2]%=MOD;
        }
        else if(k==1){
          dp[i-1][j][0]+=dp[i][j][k]%MOD;
          dp[i-1][j][0]%=MOD;
          dp[i-1][j][1]+=dp[i][j][k]*(i-1)%MOD;
          dp[i-1][j][1]%=MOD;
          dp[i][j+1][2]+=dp[i][j][k]%MOD;
          dp[i][j+1][2]%=MOD;
        }
        else{
          dp[i-1][j][0]+=dp[i][j][k]%MOD;
          dp[i-1][j][0]%=MOD;
          dp[i-1][j][1]+=dp[i][j][k]*(i-1)%MOD;
          dp[i-1][j][1]%=MOD;
        }
      }
    }
  }
  rep(i,a+1){
    FOR(j,1,a+2){
      if(j>n-a)continue;
      ans+=dp[i][j][2]*KAI(i)%MOD*co[j-1]%MOD;
      ans%=MOD;
    }
  }
  rep(i,n-a){
    ans*=(i+1);
    ans%=MOD;
  }
  printf("%lld",ans);
}