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;
namespace Base{
	# define mr make_pair
	typedef long long ll;
	typedef double db;
	const int inf = 0x3f3f3f3f, INF = 0x7fffffff;
	const ll  infll = 0x3f3f3f3f3f3f3f3fll, INFll = 0x7fffffffffffffffll;
	template<typename T> void read(T &x){
    	x = 0; int fh = 1; double num = 1.0; char ch = getchar();
		while (!isdigit(ch)){ if (ch == '-') fh = -1; ch = getchar(); }
		while (isdigit(ch)){ x = x * 10 + ch - '0'; ch = getchar(); }
	    if (ch == '.'){
	    	ch = getchar();
	    	while (isdigit(ch)){num /= 10; x = x + num * (ch - '0'); ch = getchar();}
		}
		x = x * fh;
	}
	template<typename T> void chmax(T &x, T y){x = x < y ? y : x;}
	template<typename T> void chmin(T &x, T y){x = x > y ? y : x;}
}
using namespace Base;

const int P = 1e9 + 7, N = 5010, M = 1e7 + 10;
int mul[M], inv[M], m, n, ans, c[N][N];
int power(int x, int y){
	int i = x; x = 1;
	while (y > 0){
		if (y & 1) x = 1ll * i * x % P;
		i = 1ll * i * i % P;
		y /= 2;
	}
	return x;
}
int main(){
	read(m); read(n);
	mul[0] = 1; for (int i = 1; i <= m; i++) mul[i] = 1ll * mul[i - 1] * i % P;
	inv[m] = power(mul[m], P - 2); 
	for (int i = m - 1; i >= 0; i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % P;
	for (int i = 0; i <= n; i++){
		c[i][0] = 1;
		for (int j = 1; j <= i; j++)
			c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % P;
	}
	for (int i = n + 1; i >= 2; i--){
		int fh;
		for (int j = 0; j <= i - 1; j++){
			if (j % 2 == 0) fh = c[i - 1][j]; else fh = -c[i - 1][j];
			int a = i - 1 - j, b = m - n, c = max(0, n - i);
			ans = (ans + 1ll * fh * mul[a + b + c] % P * a % P * inv[a + b] % P * mul[a + b - 1] % P + P) % P;
		}
	}
	cout << ans << endl;
    return 0;
}