Problem: Snuke loves colorful balls. He has a total of N×K balls, K in each of his favorite N colors. The colors are numbered 1 through N.

He will arrange all of the balls in a row from left to right, in arbitrary order. Then, for each of the N colors, he will paint the leftmost ball of that color into color 0, a color different from any of the N original colors.

After painting, how many sequences of the colors of the balls are possible? Find this number modulo 10^9+7.

Constraints

* 1≤N,K≤2,000

Input

The input is given from Standard Input in the following format:


N K


Output

Print the number of the possible sequences of the colors of the balls after painting, modulo 10^9+7.

Examples

Input

2 2


Output

4


Input

3 1


Output

1


Input

2 3


Output

14


Input

2000 2000


Output

546381702

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskF solver = new TaskF();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF {
        static final long MODULO = (long) (1e9 + 7);

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            if (k == 1) {
                out.println(1);
                return;
            }
            long[] invs = new long[k + 1];
            invs[1] = 1;
            for (int i = 2; i < invs.length; ++i) {
                invs[i] = (MODULO - (MODULO / i) * invs[((int) (MODULO % i))] % MODULO) % MODULO;
            }
            long invProd = 1;
            for (int i = 1; i <= k - 2; ++i) {
                invProd = invProd * invs[i] % MODULO;
            }
            long[] ways = new long[]{1};
            long[] sufProds = new long[k - 1];
            for (int i = 1; i < n; ++i) {
                long[] nways = new long[ways.length + 1];
                long sum = 0;
                long prefProd = 1;
                int upto = Integer.MIN_VALUE;
                for (int newZ = nways.length; newZ >= 1; --newZ) {
                    if (newZ > 1) {
                        sum += ways[newZ - 2];
                        sum %= MODULO;
                    }
                    int need = (i + 1) * k - newZ - 1;
                    if (upto < (need - (k - 2))) {
                        upto = need;
                        sufProds[0] = 1;
                        for (int j = 1; j < sufProds.length; ++j) {
                            sufProds[j] = sufProds[j - 1] * (upto - j + 1) % MODULO;
                        }
                        prefProd = 1;
                    } else {
                        prefProd *= need;
                        prefProd %= MODULO;
                    }
                    nways[newZ - 1] = (nways[newZ - 1] + sum * prefProd % MODULO * sufProds[upto - (need - (k - 2))] % MODULO * invProd % MODULO) % MODULO;
                }
                ways = nways;
            }
            long res = 0;
            for (long x : ways) res += x;
            res %= MODULO;
            for (int i = 1; i <= n; ++i) {
                res = res * i % MODULO;
            }
            out.println(res);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}