Problem: Once, during a lesson, Sasha got bored and decided to talk with his friends. Suddenly, he saw Kefa. Since we can talk endlessly about Kefa, we won't even start doing that. The conversation turned to graphs. Kefa promised Sasha to tell him about one interesting fact from graph theory if Sasha helps Kefa to count the number of beautiful trees. 

In this task, a tree is a weighted connected graph, consisting of n vertices and n-1 edges, and weights of edges are integers from 1 to m. Kefa determines the beauty of a tree as follows: he finds in the tree his two favorite vertices — vertices with numbers a and b, and counts the distance between them. The distance between two vertices x and y is the sum of weights of edges on the simple path from x to y. If the distance between two vertices a and b is equal to m, then the tree is beautiful.

Sasha likes graph theory, and even more, Sasha likes interesting facts, that's why he agreed to help Kefa. Luckily, Sasha is familiar with you the best programmer in Byteland. Help Sasha to count the number of beautiful trees for Kefa. Two trees are considered to be distinct if there is an edge that occurs in one of them and doesn't occur in the other one. Edge's weight matters.

Kefa warned Sasha, that there can be too many beautiful trees, so it will be enough to count the number modulo 10^9 + 7.

Input

The first line contains four integers n, m, a, b (2 ≤ n ≤ 10^6, 1 ≤ m ≤ 10^6, 1 ≤ a, b ≤ n, a ≠ b) — the number of vertices in the tree, the maximum weight of an edge and two Kefa's favorite vertices.

Output

Print one integer — the number of beautiful trees modulo 10^9+7.

Examples

Input


3 2 1 3


Output


5


Input


3 1 1 2


Output


2


Input


5 15 1 5


Output


345444

Note

There are 5 beautiful trees in the first example:

<image>

In the second example the following trees are beautiful:

<image>

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class DSashaAndInterestingFactFromGraphTheory {
        int mod = 1000000007;
        long[] fac;
        long[] ifac;
        long[] t;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();

            int m = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();

            fac = factorial(2000000, mod);
            ifac = factorialInverse(2000000, mod);

            t = new long[n + 1];

            t[n] = 1;
            for (int i = 2; i < n; i++) {
                t[i] = i * pow(n, n - i - 1, mod);
                t[i] %= mod;
            }


            long ans = 0;

            for (int i = 0; i <= Math.min(n - 2, m - 1); i++) {

                long val = fac[n - 2];
                val *= ifac[n - 2 - i];

                val %= mod;

                val *= t[i + 2];
                val %= mod;

                int re = n - 1;
                re -= (i + 1);

                val *= pow(m, re, mod);
                val %= mod;

                int rw = m;

                rw -= (i + 1);

                val *= fac[rw + i];
                val %= mod;
                val *= ifac[i];
                val %= mod;
                val *= ifac[rw];
                val %= mod;

                ans += val;
                ans %= mod;
            }

            out.println(ans);
        }

        long pow(long a, long p, int mod) {
            if (p == 0) {
                return 1;
            }

            long t = pow(a, p / 2, mod);

            if (p % 2 != 0) {
                return (((t * t) % mod) * a) % mod;
            } else {
                return (t * t) % mod;
            }
        }

        long[] factorial(int n, int mod) {
            long[] factorial = new long[n + 1];

            factorial[0] = 1;

            for (int i = 1; i <= n; i++) {
                factorial[i] = i * factorial[i - 1];
                factorial[i] %= mod;
            }

            return factorial;
        }

        long[] factorialInverse(int n, int mod) {
            long[] factorialInverse = new long[n + 1];

            long[] inv = new long[n + 1];

            inv[1] = 1;

            for (int i = 2; i <= n; i++) {
                inv[i] = inv[mod % i];
                inv[i] *= (mod - mod / i);
                inv[i] %= mod;
            }

            factorialInverse[0] = 1;

            for (int i = 1; i <= n; i++) {
                //factorialInverse[i] = pow(i, mod - 2, mod) * factorialInverse[i - 1];
                factorialInverse[i] = inv[i] * factorialInverse[i - 1];
                factorialInverse[i] %= mod;
            }

            return factorialInverse;
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(long i) {
            writer.println(i);
        }

    }
}