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 ll long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

using namespace std;

const int mod = 1000000007;
const int N = 10010007;
const int M = 5007;

int fact[N];

inline int mult(int a, int b) {
	return ((ll) a * b) % mod;
}

inline int sum(int a, int b) {
	if (a+b < 0) return a+b+mod;
	if (a+b >= mod) return a+b-mod;
	return a+b;
}

int pw(int x, int y) {

	int ans = 1;
	int deg = x;

	for (int i = 0; i < 30; ++i) {
		if ((1<<i)&y) {
			ans = mult(ans, deg);
		}
		deg = mult(deg, deg);
	}

	return ans;

}

int dp[M][M][2][2];

int C(int n, int k) {
	int x = mult(pw(fact[k], mod-2), pw(fact[n-k], mod-2));
	return mult(fact[n], x);
}

int box[M];

int main(){
#ifdef LOCAL
	freopen("F_input.txt", "r", stdin);
	//freopen("F_output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n, k;
	cin >> n >> k;

	fact[0] = 1;
	for (int i = 1; i < N; ++i) fact[i] = mult(fact[i-1], i);

	dp[0][0][0][0] = 1;

	for (int was = 0; was <= k; ++was) {
		for (int one = 0; one <= k; ++one) {
			for (int start = 1; start >= 0; start--) {
				for (int take = 0; take <= 1; ++take) {

					if (!dp[was][one][start][take]) continue;

					if (start == 0) {
						dp[was+1][one+1][0][1] = sum(dp[was+1][one+1][0][1], dp[was][one][start][take]);

						int have = k-was;

						if (have >= 2) {
							dp[was+2][one][1][0] = sum(dp[was+2][one][1][0], mult(dp[was][one][start][take], have - 1));
							dp[was+2][one+1][1][1] = sum(dp[was+2][one+1][1][1], mult(dp[was][one][start][take], 2*have - 2));
							dp[was+2][one+2][1][1] = sum(dp[was+2][one+2][1][1], mult(dp[was][one][start][take], have-1));
						}
					}

					else {

						int have = k-was;

						dp[was+1][one+1][1][1] = sum(dp[was+1][one+1][1][1], mult(dp[was][one][start][take], have));
						dp[was+1][one][1][take] = sum(dp[was+1][one][1][take], mult(dp[was][one][start][take], have));
						dp[was][one][0][take] = sum(dp[was][one][0][take], dp[was][one][start][take]);
					}

				} 
			}
		}
	}

	int ans = 0;

	int dop = n-k;

	box[0] = 0;
	for (int i = 1; i < M; ++i) {
		if (i > dop) continue;
		box[i] = C(dop-1, i-1);

	}

	for (int i = 0; i < M; ++i) {
		box[i] = mult(box[i], fact[dop]);
	}

	//cout << box[1] << endl;

	//cout << pw(1, 2) << endl;

	//cout << dp[2][2][1][1] << endl;

	//cout << dp[1][1][0][1] << endl;

	for (int i = 0; i <= k; ++i) for (int j = 0; j <= k; ++j) {
		if (!dp[i][j][0][1]) continue;
		if (j > dop) continue;

		int res = dp[i][j][0][1];

		res = mult(res, box[j]);

		res = mult(res, fact[k-i]);
/*
		if (res) {
			cout << res << " " << i << " " << j << endl;
		}
*/
		ans = sum(ans, res);
	}

	cout << ans;





}