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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int INF = 1.01e9;
namespace mod {
const int MOD = (int)1e9 + 7;
void add(int &a, long long b) { a = (a + b) % MOD; }
int mul(int a, int b) { return 1LL * a * b % MOD; }
int bin(int a, long long n) {
  int res = 1;
  while (n) {
    if (n & 1) res = 1LL * res * a % MOD;
    a = 1LL * a * a % MOD;
    n >>= 1;
  }
  return res;
}
int inv(int x) { return bin(x, MOD - 2); }
vector<int> fct, ofct, rev;
void ensureFact(int n) {
  if ((int)fct.size() > n) return;
  int old = fct.size();
  fct.resize(n + 1);
  ofct.resize(n + 1);
  rev.resize(n + 1);
  if (old == 0) {
    fct[0] = ofct[0] = 1;
    rev[0] = 0;
    old++;
  }
  for (int i = old; i <= n; i++) {
    fct[i] = mul(fct[i - 1], i);
    if (i == 1)
      rev[i] = 1;
    else
      rev[i] = (MOD - mul(MOD / i, rev[MOD % i])) % MOD;
    ofct[i] = mul(ofct[i - 1], rev[i]);
  }
}
int getC(int n, int k) {
  if (n < k || k < 0) return 0;
  ensureFact(n);
  return mul(fct[n], mul(ofct[k], ofct[n - k]));
}
}  // namespace mod
using namespace mod;
int getC2(int n, int k) { return getC(n + k - 1, k - 1); }
int solve(int n, int m, int a, int b) {
  int res = 0;
  for (int len = 1; len < n; len++) {
    int s = n - len;
    int cur = bin(n, max(0, s - 2));
    if (s == 1) cur = 1LL * cur * inv(n) % MOD;
    cur = 1LL * cur * (len + 1) % MOD;
    if (len > 1)
      cur = 1LL * cur * getC(n - 2, len - 1) % MOD * fct[len - 1] % MOD;
    cur = 1LL * cur * bin(m, n - 1 - len) % MOD;
    cur = 1LL * cur * getC2(m - len, len) % MOD;
    res = (res + cur) % MOD;
  }
  return res;
}
int main() {
  if (0) {
    for (int n = 2; n <= 9; n++) {
      vector<int> ans(n);
      vector<int> pr(n);
      function<void(int)> rec = [&](int x) {
        if (x == n) {
          for (int i = 0; i < n; i++) {
            int cur = i;
            for (int j = 0; j < n; j++) cur = pr[cur];
            if (cur != 0) return;
          }
          int len = 0;
          int cur = 1;
          while (cur != 0) {
            cur = pr[cur];
            len++;
          }
          ans[len]++;
          return;
        }
        for (int i = 0; i < n; i++) {
          pr[x] = i;
          rec(x + 1);
        }
      };
      rec(1);
      int sum = 0;
      cout << n << ": ";
      for (int i = (int)ans.size() - 1; i > 0; i--) {
        int x = ans[i];
        sum += x;
        cout << x << " ";
      }
      cout << endl;
    }
    return 0;
  }
  if (0) {
    for (int n = 2; n <= 6; n++) {
      for (int m = 1; m <= 6; m++) {
        cout << solve(n, m, 1, 2) << " ";
      }
      cout << endl;
    }
    return 0;
  }
  int n, m, a, b;
  while (cin >> n >> m >> a >> b) {
    cout << solve(n, m, a, b) << endl;
  }
}