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.*;
import java.util.*;

public class CFD {

    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    private static long MOD = 1000L * 1000L * 1000L + 7;
    private static final int[] dx = {0, -1, 0, 1};
    private static final int[] dy = {1, 0, -1, 0};
    private static final String yes = "Yes";
    private static final String no = "No";

    int n;
    int m;
    int a;
    int b;
    int LIMIT = 1000 * 1000 + 10;
    long[] fact;
    long[] invfact;
    long[] powN;
    long[] powM;
    void solve() throws IOException {
        n = nextInt();
        m = nextInt();
        a = nextInt();
        b = nextInt();

        fact = new long[LIMIT];
        invfact = new long[LIMIT];
        fact[0] = 1;
        for (int i = 1; i < LIMIT; i++) {
            fact[i] = fact[i - 1] * i % MOD;
        }

        invfact[LIMIT - 1] = powMod(fact[LIMIT - 1], MOD - 2, MOD);
        for (int i = LIMIT - 2; i >= 0; i--) {
            invfact[i] = invfact[i + 1] * (i + 1) % MOD;
        }

        powN = new long[LIMIT];
        powM = new long[LIMIT];
        powN[0] = 1;
        powM[0] = 1;
        for (int i = 1; i < LIMIT; i++) {
            powN[i] = n * powN[i - 1] % MOD;
            powM[i] = m * powM[i - 1] % MOD;
        }

        long res = 0;
        for (int i = 0; i <= Math.min(m - 1, n - 2); i++) {
            int left = n - (i + 2);
            // (n - i - 1) * (n - i) *...* (n - 2)
            long extra = fact[n - 2] * invfact[n - i - 2] % MOD;
            extra *= comb(m - 1, i);
            extra %= MOD;
            extra *= caley(n, i + 2);
            extra %= MOD;
            extra *= powM[left];
            extra %= MOD;
            res += extra;
            if (res >= MOD) {
                res -= MOD;
            }

            if (res >= MOD) {
                res -= MOD;
            }
        }

        outln(res % MOD);
    }

    long caley(int n, int k) {
        if (k >= n) {
            return 1;
        }
        return k * powN[n - k - 1] % MOD;
    }

    long comb(int n, int r) {
        long res = fact[n] * invfact[r] % MOD;
        res = res * invfact[n - r] % MOD;
        return res;
    }

    // return 1/a module MOD, which is a ^ (MOD - 2) % MOD
    long inverseMod(long a, long MOD) {
        return powMod(a, MOD - 2, MOD);
    }

    // Power Calculate N^M % MOD, N and M can be long (up to 2^64, ~10^18)
    public long powMod(long N, long M, long MOD){//N^M % MOD
        if(M == 0L)
            return 1L;
        long[] hp = new long[64];
        boolean[] bp = new boolean[64];
        hp[0] = N;
        for(int i = 1; i < hp.length; i++) {
            hp[i] = (hp[i - 1] * hp[i - 1]) % MOD;
        }
        for(int j = 0; j < hp.length; j++) {
            if((M & (1L << j)) != 0)
                bp[j] = true;
        }
        long res = 1;
        for(int i = 0;i < bp.length; i++){
            if(bp[i]) {
                res = (res * hp[i]) % MOD;
            }
        }
        return res;
    }

    void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }
    long gcd(long a, long b) {
        while(a != 0 && b != 0) {
            long c = b;
            b = a % b;
            a = c;
        }
        return a + b;
    }
    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    private void formatPrint(double val) {
        outln(String.format("%.9f%n", val));
    }
    public CFD() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new CFD();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}