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:
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// gp_hash_table<int, int> mapka;

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C &a4, C b4) { a4 = min(a4, b4); }
template<class C> void maxi(C &a4, C b4) { a4 = max(a4, b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

const int MAX = 1e7 + 5;
const int P = 1e9 + 7;
int n,k;
int sil[MAX];
int mul(int a,int b){
  return a * b % P;
}
void sub(int &a,int b){
  a -= b;
  if(a < 0)a += P;
}
void add(int &a,int b){
  a += b;
  if(a >= P)
    a-=P;
}

int pot(int a,int w){
  int r = 1;
  while(w){
    if(w & 1){
      r = a * r % P;
    }
    w/=2;
    a = a * a % P;
  }
  return r;
}
const int MAXK = 5001;
int dwu[MAXK][MAXK];
int dp[MAXK];
int odw[MAXK];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  cin >> n >> k;
  sil[0] = 1;
  R(i,n + 1){
    sil[i+1] = mul(sil[i], i+1);
  }
  R(i,k+1){
    odw[i] = pot(sil[i], P-2);
  }
  R(i,k+1)R(j,i+1){
    if(j == 0){
      dwu[i][j] = 1;
    }else{
      dwu[i][j] = dwu[i-1][j-1];
      add(dwu[i][j], dwu[i-1][j]);
    }
  }
  for(int i = 1; i <= k; i++){
    dp[i] = mul(i, sil[n - k + i - 1]);
    for(int j = 1; j < i; j++)
      sub(dp[i], mul(dwu[i][j], dp[j]));
  }
  int res = dp[k];
  vector<int> sum(k + 1);
  for(int i = k; i >= 2;i --){
    for(int z = 2; z <= i; z++){
      int mn = ((i + z)&1 ? P-1 : 1);
      mn = mul(mn, dwu[i-1][i-z]);
      mn = mul(mn, z-1);
      mn = mul(mn, sil[k-i]);
      debug(n,z,i);
      add(sum[z], mul(sil[n + z - i - 2], odw[k-i]));
      mn = mul(mn, sum[z]);
      add(res, mn);
    }
  }
  cout << res << "\n";
}