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>

using namespace std;

const int maxn = 10000010;
const int maxa = 5010;
const int mod = 1e9+7;

int n, a;

int fac[maxn+maxa], ifac[maxn+maxa], inv[maxn+maxa];

int binom(int x, int y) {
	if (y > x) return 0;
	return 1LL * fac[x] * ifac[y] % mod * ifac[x - y] % mod;
}

int cal(int x, int y) {
	if (!y) return 1;
	if (x) return 1LL * fac[x + y - 1] * ifac[x - 1] % mod;
	else return 0;
}

int main() {
	scanf("%d%d", &n, &a);
	fac[0] = ifac[0] = 1, inv[1] = 1;
	for (int i = 2; i <= n+a; i++) inv[i] = mod - 1LL * inv[mod % i] * (mod / i) % mod;
	for (int i = 1; i <= n+a; i++) {
		fac[i] = 1LL * fac[i-1] * i % mod;
		ifac[i] = 1LL * ifac[i-1] * inv[i] % mod;
	}
	int ans = 0;
	for (int p = 1; p <= a; p++) {
		for (int k = 0; k < p; k++) {
			if (k == p-1) {
				int K = binom(p-1, k); if (k & 1) K = mod - K;
				for (int s = p-1; s <= a-1; s++) {
					int w = 1;
					w = 1LL * w * binom(a-p, s-p+1) % mod;
					w = 1LL * w * cal(s-k, n-a) % mod;
					w = 1LL * w * fac[a-s-1] % mod;
					w = 1LL * w * cal(p-1-k, s-p+1) % mod;
					w = 1LL * w * fac[p-1-k] % mod;
					ans = (ans + 1LL * K * w % mod) % mod;
				}
			} else {
				int K = binom(p-1, k); if (k & 1) K = mod - K;
				int w = 1;
				w = 1LL * w * (p-1-k) % mod;
				w = 1LL * w * fac[a-p] % mod;
				w = 1LL * w * fac[p-k+n-a-2] % mod;
				w = 1LL * w * binom(n-k-1, a-p) % mod;
				ans = (ans + 1LL * K * w % mod) % mod;
			}
		}
	}
	// 一个自环都没得
	{
		for (int k = 0; k <= a; k++) {
			int K = binom(a, k); if (k & 1) K = mod - K;
			ans = (ans + 1LL * fac[a - k] * cal(a - k, n - a) % mod * K % mod) % mod;
		}
	}
	printf("%d\n", ans);
	return 0;
}