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:
#pragma GCC optimize("O3")   //
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;
typedef unsigned long long ull;

unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 eng(seed);

uniform_int_distribution<> DD(0, (1ll << 31));

ll random2(){
    return (ll(DD(eng))*(1ll << 31) + ll(DD(eng))) & ((1ll << 62ll)-1);
}

ll n,m,k,q,T;

const ll big = 1000000007;
const ll big2 = 1000000009;
const ll mod =  998244353;


const int MAXN = 10000001;

ll FAC2[MAXN] = {0};
ll FAC[MAXN] = {0};
ll IFAC[MAXN] = {0};

ll upp(ll i, ll j){
    if(j == 0)return 1;
    ll h = upp(i,j/2);
    if(j%2 == 0)return (h*h)%big;
    return (i*((h*h)%big))%big;
}

ll DP[5002][5002] = {0};

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    //freopen("input.txt","r",stdin);
    //freopen("autput.txt","w",stdout);

    ll a,b,c,d,e;

    cin >> n >> m;

    ll nf = 1;
    ll nf2 = 1;

    rep(c1,0,n){
        FAC2[c1] = nf2;
        nf2 *= ll(n-c1);
        nf2 %= big;
        FAC[c1] = nf;
        nf *= ll(c1+1);
        nf %= big;
    }

    rep(c1,0,m+1){
        IFAC[c1] = upp(FAC[c1], big-2);
    }

    ll no_self = 0;
    ll t = 1;
    for(ll s = 0; s <= m; s++){
        ll bin = (((FAC[m]*IFAC[s])%big)*IFAC[m-s])%big;
        no_self += t * (bin*(((m-s) * FAC[n-s-1])%big))%big;
        if(no_self < 0)no_self += big;
        if(no_self >= big)no_self -= big;

        t *= -1;
    }

    ll ans = no_self;


    ll self_cyc = 0;


    for(ll M = m; M >= 0; M--){
        for(ll x = 0; x <= m; x++){
            if(n-M-x-2 < 0){
                DP[M][x] = 0;
                continue;
            }
            if(x == 0){
                DP[M][x] = FAC[n-M-2];
                continue;
            }
            if(M == m){
                DP[M][x] = 0;
                for(ll b = 0; b <= x; b++){
                    DP[M][x] += IFAC[x-b]*((FAC[n-M-b-2] * FAC[x])%big);
                    DP[M][x] %= big;
                }
                continue;
            }
            DP[M][x] = x*DP[M+1][x-1] + FAC[n-M-2];// + FAC[n-M-2-x] * FAC[x];
            DP[M][x] %= big;
        }
    }

    for(ll x = 2; x <= m; x++){

        ll t = 1;
        for(ll s = 0; s < x-1; s++){
            ll ts = big+t;
            ts *= (x-1-s);
            ts %= big;
            ts *= FAC[x-1];
            ts %= big;
            ts *= IFAC[s];
            ts %= big;
            ts *= IFAC[x-1-s];
            ts %= big;

            ans += ts*DP[s][m-x];
            ans %= big;

            t *= -1;
        }

    }

    cout << ans << "\n";

    return 0;
}