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:
//khodaya khodet komak kon
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")


using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int N = 20000000 + 10;
const ll MOD = 1000000000 + 7;
const ll INF = 1000000010;
const ll LOG = 25;

int n, a, fac[N], inv[N];

int POW(int a, int b){
	int res = 1;
	while (b){
		if (b & 1) res = res * 1ll * a % MOD;
		b >>= 1;
		a = a * 1ll * a % MOD;
	}
	return res;
}

int nCr(int a, int b){
	if (a < b || a < 0 || b < 0) return 0;
	int res = fac[a];
	res = res * 1ll * inv[b] % MOD;
	res = res * 1ll * inv[a - b] % MOD;
	return res;
}

int mul(int a, int b){
	return a * 1ll * b % MOD;
}

int32_t main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> a;
	fac[0] = 1;
	for (int i = 1; i < N; i++) fac[i] = (fac[i - 1] * 1ll * i) % MOD;
	inv[N - 1] = POW(fac[N - 1], MOD - 2);
	for (int i = N - 2; i >= 0; i--){
		inv[i] = (inv[i + 1] * 1ll * (i + 1)) % MOD;
	}
//	cout << "YES" << endl;
//	cout << nCr(6,3) << '\n';
	int b = n - a;
	int ans = 0;
	for (int i = 1; i <= a + 1; i++){
		int res = 0;
		if (i == 1 && n == a){
			ans++;
			continue;
		}
		for (int j = 0; j < i - 1; j++){
			int delta = nCr(i - 1, j);
			int x = i - 1 - j;
			int c = max(0, a - i);
			delta = mul(delta, fac[x + b + c]);
			delta = mul(delta, mul(x, mul(inv[x + b], fac[x + b - 1])));
			res += ((j % 2)?-delta:delta);
			res %= MOD;
			res += MOD;
			res %= MOD;
//			cout << i << ' ' << j << ' ' << x << ' ' << b << ' ' << c << ' ' << res << '\n';
		}
//		cout << res << '\n';
		ans = (ans + res) % MOD;
	}
	cout << ans;








	return 0;
}