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;
template <class T>
constexpr T lcm(T m, T n) {
  return m / __gcd(m, n) * n;
}
template <typename T>
using V = vector<T>;
template <typename T, typename U>
using P = pair<T, U>;
template <typename I>
void join(ostream &ost, I s, I t, string d = " ") {
  for (auto i = s; i != t; ++i) {
    if (i != s) ost << d;
    ost << *i;
  }
  ost << endl;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (auto &a : v) is >> a;
  return is;
}
template <typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
T &chmin(T &a, const U &b) {
  return a = (a <= b ? a : b);
}
template <typename T, typename U>
T &chmax(T &a, const U &b) {
  return a = (a >= b ? a : b);
}
template <typename T, size_t N, typename U>
void fill_array(T (&a)[N], const U &v) {
  fill((U *)a, (U *)(a + N), v);
}
long long int power(long long int n, long long int p, long long int m) {
  long long int ret = 1;
  while (p > 0) {
    if (p & 1) (ret *= n) %= m;
    (n *= n) %= m;
    p /= 2;
  }
  return ret;
}
template <typename T>
long long int mod_inv(T n, T p) {
  return power(n, p - 2, p);
}
template <long long int mod>
class Combination {
 public:
  vector<long long int> facto = {1};
  vector<long long int> ifacto = {1};
  long long int factorial(long long int i) {
    if (i < 0) return 0;
    if (facto.size() <= i) facto.resize(i + 1, -1);
    if (i == 0) return facto[0] = 1;
    long long int j = i;
    for (; j >= 0; --j)
      if (facto[j] != -1) break;
    for (long long int k = j + 1; k <= i; ++k)
      (facto[k] = facto[k - 1] * k) %= mod;
    return facto[i];
  }
  long long int factorial_inverse(long long int i) {
    if (i < 0) return 0;
    if (ifacto.size() <= i) ifacto.resize(i + 1, -1);
    if (ifacto[i] != -1) return ifacto[i];
    return ifacto[i] = mod_inv(factorial(i), mod);
  }
  long long int P(long long int n, long long int k) {
    return (factorial(n) * factorial_inverse(n - k)) % mod;
  }
  long long int C(long long int n, long long int k) {
    return (P(n, k) * factorial_inverse(k)) % mod;
  }
  long long int H(long long int n, long long int k) { return C(n + k - 1, n); }
};
const long long int mod = 1e9 + 7;
long long int f(long long int n, long long int k) {
  if (n - k - 1 < 0) {
    return (k * mod_inv(power(n, -(n - k - 1), mod), mod)) % mod;
  } else {
    return (k * power(n, n - k - 1, mod)) % mod;
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  Combination<mod> com;
  int n, m, a, b;
  while (cin >> n >> m >> a >> b) {
    long long int ans = 0;
    for (int i = (1); i <= (n - 1); ++i) {
      long long int t = com.P(n - 2, i - 1) * com.C(m - 1, i - 1) % mod *
                        power(m, n - i - 1, mod) % mod * f(n, i + 1) % mod;
      (ans += t) %= mod;
    }
    cout << ans << endl;
  }
  return 0;
}