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 <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <cstring>
#include <list>  
#include <cassert>
#include <climits>
#include <bitset>
#include <chrono>
#include <random>
using namespace std;

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
std::mt19937 rnd((int)std::chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }

const int MAXN = 10000000;
const int MAXON = 5000;
const int MOD = 1000000007;
void inc(int &a, int b) { if ((a += b) >= MOD) a -= MOD; }
void dec(int &a, int b) { inc(a, MOD - b); }

int inv[MAXN + 1];
int fac[MAXN + 1];
int ifac[MAXN + 1];

int prod(int l, int h) { return (ll)fac[h] * ifac[l - 1] % MOD; }
int choose(int n, int k) { if (k<0 || k>n) return 0; return (ll)fac[n] * ifac[k] % MOD*ifac[n - k] % MOD; }

// a items that we pick, b items that should be in the same cycles, c items that we don't care about
int calc(int a, int b, int c) {
	int ret = 0;
	FORE(i, 1,a) {
		// i items are non-identity
		int cur = fac[i];
		cur = (ll)cur*prod(i, i + b - 1) % MOD;
		cur = (ll)cur*prod(i + b + 1, i + b + c) % MOD;
		cur = (ll)cur*choose(a, i) % MOD;
		//printf("\t(%d,%d,%d): %d = %d\n", a, b, c, i, cur);
		if ((a - i) % 2 == 0) inc(ret, cur); else dec(ret, cur);
	}
	return ret;
}

int n, on;

int solve() {
	inv[1] = 1; FORE(i, 2, n) inv[i] = (ll)(MOD - MOD / i)*inv[MOD%i] % MOD;
	fac[0] = 1; FORE(i, 1, n) fac[i] = (ll)fac[i - 1] * i%MOD;
	ifac[0] = 1; FORE(i, 1, n) ifac[i] = (ll)ifac[i - 1] * inv[i] % MOD;

	int ret = 0;
	int off = n - on;
	FORE(i, 1, on) {
		int cur = calc(i, off, i == on ? 0 : on - i - 1);
		//printf("%d: %d\n", i, cur);
		inc(ret, cur);
	}
	return ret;
}

void run() {
	scanf("%d%d", &n, &on);
	printf("%d\n", solve());
}

int main() {
	run();
	return 0;
}