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;
default_random_engine generator;
uniform_int_distribution<int> distribution(1, INT_MAX);
long long my_rand(long long a = 0, long long b = INT_MAX) {
  return a + distribution(generator) % b;
}
inline int mul(int a, int b) {
  return int(a * 1ll * b % (1000 * 1000 * 1000 + 7));
}
inline int norm(int a) {
  if (a >= (1000 * 1000 * 1000 + 7)) a -= (1000 * 1000 * 1000 + 7);
  if (a < 0) a += (1000 * 1000 * 1000 + 7);
  return a;
}
inline int binPow(int a, int k) {
  int ans = 1;
  while (k > 0) {
    if (k & 1) ans = mul(ans, a);
    a = mul(a, a);
    k >>= 1;
  }
  return ans;
}
inline int subtract(int a, int b) { return norm(a - b); }
inline int sum(int a, int b) { return int((a + b) % (1000 * 1000 * 1000 + 7)); }
inline int inv(int a) { return binPow(a, (1000 * 1000 * 1000 + 7) - 2); }
long long ceil_int(long long a, long long b) { return a / b + (a % b != 0); }
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int n, m, a, b;
vector<int> dp;
long long v1(long long q) { return (3 * q * q - q) / 2; }
long long v2(long long q) { return (3 * q * q + q) / 2; }
int fact[2000000];
int stp[2000000];
int stp2[2000000];
int c_nk(int n1, int k1) {
  if (k1 > n1) return 1;
  return mul(fact[n1], inv(mul(fact[n1 - k1], fact[k1])));
}
int caley(int n, int k) {
  if (n - k - 1 < 0) {
    return mul(k, inv(n));
  }
  return mul(k, stp[n - k - 1]);
}
int main() {
  generator.seed(chrono::system_clock::now().time_since_epoch().count());
  cin.sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> a >> b;
  fact[0] = 1;
  stp[0] = 1;
  stp2[0] = 1;
  for (int i = 1; i <= 1500000; i++) {
    fact[i] = mul(fact[i - 1], i);
    stp[i] = mul(stp[i - 1], n);
    stp2[i] = mul(stp2[i - 1], m);
  }
  int res = 0;
  for (int edges = 1; edges < n; edges++) {
    if (edges > m) break;
    int vert = edges + 1;
    int free_vert = n - (edges + 1);
    int ways = c_nk(m - 1, edges - 1);
    ways = mul(ways, caley(n, vert));
    ways = mul(ways, stp2[free_vert]);
    ways = mul(ways, c_nk(n - 2, free_vert));
    ways = mul(ways, fact[vert - 2]);
    res = sum(res, ways);
    res = norm(res);
  }
  cout << res;
  return 0;
}