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.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
 *
 * @author Hieu Le
 */
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);
    TaskD solver = new TaskD();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskD {
    private static final long MOD = (long) 1e9 + 7;
    private static final int MAX = (int) 1e6;
    private long[] facts;
    private long[] invFacts;

    public TaskD() {
      facts = new long[MAX + 1];
      facts[0] = 1;
      for (int i = 1; i < MAX + 1; ++i) {
        facts[i] = facts[i - 1] * i % MOD;
      }

      invFacts = new long[MAX + 1];
      invFacts[MAX] = modPow(facts[MAX], MOD - 2);
      for (int i = MAX - 1; i >= 0; --i) {
        invFacts[i] = invFacts[i + 1] * (i + 1) % MOD;
      }
    }

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

      long res = 0;
      for (int dist = 1; dist <= Math.min(m, n - 1); ++dist) {
        long tmp = 1;

        // number of ways to get sum m from dist numbers
        tmp = tmp * countSum(m, dist) % MOD;
        // number of ways to pick nodes between
        tmp = tmp * nPk(n - 2, dist - 1) % MOD;
        // Number of ways to assign weights to the remaining edges
        tmp = tmp * modPow(m, n - 1 - dist) % MOD;
        // Number of ways to arrange the remaining nodes
        if (n > dist + 1) {
          tmp = tmp * magic(n, dist + 1) % MOD;
        }

        res = (res + tmp) % MOD;
      }

      out.println(res);
    }

    private long magic(int n, int k) {
      return modPow(n, n - k - 1) * k % MOD;
    }

    private long countSum(int sum, int n) {
      return nCk(sum - 1, n - 1);
    }

    private long nCk(int n, int k) {
      long res = facts[n] * invFacts[k] % MOD;
      return res * invFacts[n - k] % MOD;
    }

    private long nPk(int n, int k) {
      return facts[n] * invFacts[n - k] % MOD;
    }

    private long modPow(long base, long exponent) {
      if (exponent < 0) throw new RuntimeException();
      if (exponent == 0) return 1;
      long res = modPow(base, exponent / 2);
      res = res * res % MOD;
      if (exponent % 2 == 1) res = res * base % MOD;
      return res;
    }
  }

  static class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    private static final int BUFFER_SIZE = 32768;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), BUFFER_SIZE);
      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());
    }
  }
}