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>

namespace IO
{
char gc()
{
#ifdef FREAD
	static char buf[1<<21], *P1 = buf, *P2 = buf;
	if(P1 == P2)
	{
		P1 = buf;
		P2 = buf + fread(buf, 1, 1<<21, stdin);
		if(P1 == P2) return EOF;
	}
	return *(P1++);
#else
	return getchar();
#endif
}
template<typename Tp> bool get1(Tp &x)
{
	bool neg = 0;
	char c = gc();
	while( c != EOF && (c < '0' || c > '9') && c != '-' ) c = gc();
	if(c == '-') c = gc(), neg = 1;
	if(c == EOF) return false;
	x = 0;
	for(; c>='0' && c<='9'; c = gc()) x = x*10 + c - '0';
	if(neg) x = -x;
	return true;
}
template<typename Tp> void printendl(Tp x)
{
	if(x<0)putchar('-'),x=-x;
	static short a[40], sz;
	sz = 0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
	puts("");
}
} // namespace IO
using IO::get1;
using IO::printendl;
#define get2(x,y) get1(x) && get1(y)
#define get3(x,y,z) get2(x,y) && get1(z)
#define get4(x,y,z,w) get3(x,y,z) && get1(w)
#define pb push_back
#define mp std::make_pair
#define ff first
#define ss second
typedef long long LL;
typedef unsigned long long uLL;
typedef std::pair<int,int> pii;
const int inf = 0x3f3f3f3f;
const LL Linf = 1ll<<61;

const int maxn = 10000111;
const int maxa = 5111;
const int mod = 1e9 + 7;
int qpow(int x, int y)
{
	int ret = 1;
	while(y)
	{
		if(y & 1) ret = 1ll * ret * x % mod;
		x = 1ll * x * x % mod;
		y >>= 1;
	}
	return ret;
}

int n, a, fac[maxn], inv[maxn], c[maxa][maxa];
int main()
{
	fac[0] = 1; for(int i=1; i<maxn; i++) fac[i] = 1ll * i * fac[i-1] % mod;
	inv[1] = 1; for(int i=2; i<maxn; i++) inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
	for(int i=0; i<maxa; i++)
	{
		c[i][0] = 1;
		for(int j=1; j<=i; j++)
		{
			c[i][j] = c[i-1][j] + c[i-1][j-1];
			if(c[i][j] >= mod) c[i][j] -= mod;
		}
	}
	
	get2(n, a);
	
	int ans = 0;
	for(int i=1; i<=a; i++)
	{
		int sum = 1ll * fac[i == a ? n : n - 1] * i % mod * inv[i + n - a] % mod;
		for(int j=1; j<i; j++)
		{
			int now = 1ll * c[i][j] * fac[(i == a ? n : n - 1) - j] % mod * (i - j) % mod * inv[i - j + n - a] % mod;
			if(j & 1)
			{
				sum -= now;
				if(sum < 0) sum += mod;
			}
			else
			{
				sum += now;
				if(sum >= mod) sum -= mod;
			}
		}
		ans += sum;
		if(ans >= mod) ans -= mod;
	}
	printendl(ans);
	return 0;
}