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 MOD = 1000 * 1000 * 1000 + 7;


const int N = 10 * 1000 * 1000 + 6000;
const int NREV = 5005;

long long fact[N], revFact[N];

long long expo(long long a, long long n, long long mod) {
    long long ans = 1;

    while (n) {
        if (n & 1LL) ans = (ans * a) % mod;

        n >>= 1;
        a = (a * a) % mod;
    }

    return ans;
}

long long revMod(long long a, long long mod) {
    return expo(a, mod - 2, mod);
}

void pre() {
    fact[0] = revFact[0] = 1;

    for (int i = 1; i < N; i++) {
        fact[i] = (i * fact[i-1]) % MOD;
        
        if (i < NREV) {
            revFact[i] = revMod(fact[i], MOD);
        }
    }
}

long long binom(int n, int m) {
    if (m > n) return 0;

    long long res = (fact[n] * revFact[n-m]) % MOD;
    res = (res * revFact[m]) % MOD;

    return res;
}


int solve(int n, int a) {
    int ans = 0;
    int q = n - a;

    for (int notLoops = 1; notLoops <= a; notLoops++) {
        int ansHere = 0;

        vector <long long> values(a + 1);

        for (int x = 0; x <= a; x++) {
            long long summand = 1;

            summand = (summand * revFact[x]) % MOD;
            summand = (summand * notLoops) % MOD;
            summand = (summand * fact[notLoops + x + q - 1]) % MOD;

            values[x] = summand;
        }

        for (int x = 1; x <= a; x++) {
            values[x] = (values[x] + values[x-1]) % MOD;
        }

        for (int loops = 0; loops < a && loops <= a - notLoops; loops++) {
            int p = loops + notLoops;
            int m = max(a - p - 1, 0);

            long long sum = values[m];

            sum = (sum * binom(p, loops)) % MOD;
            sum = (sum * fact[m]) % MOD;

            if (loops % 2 == 0) {
                ansHere = (ansHere + sum) % MOD;
            } else {
                ansHere = (ansHere + MOD - sum) % MOD;
            }
        }

        ans = (ans + ansHere) % MOD;
    }

    return ans;
}


int main() {
    ios_base::sync_with_stdio(false);
    pre();

    int n, a;
    cin >> n >> a;

    cout << solve(n, a);

    return 0;
}