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>
inline T sqr(const T& x) {
  return x * x;
}
template <class T>
inline void updMin(T& a, const T& b) {
  if (b < a) a = b;
}
template <class T>
inline void updMax(T& a, const T& b) {
  if (b > a) a = b;
}
const int M = 1000000007;
const int M2 = 1000000009;
const int maxn = 200005;
int n, m;
int f[2000000];
int mul(long long x, long long y) { return x * y % M; }
int power(int x, int p) {
  assert(p >= 0);
  int ret = 1;
  while (p > 0) {
    if (p % 2) {
      ret = mul(ret, x);
    }
    x = mul(x, x);
    p /= 2;
  }
  return ret;
}
int rev(int x) { return power(x, M - 2); }
int fact(int x) {
  assert(x >= 0);
  return f[x];
}
int c(int n, int k) {
  return mul(mul(fact(n), rev(fact(k))), rev(fact(n - k)));
}
set<long long> used;
bool alloced[100];
int N;
int a[100][100];
void gen(int v) {
  if (v == 0) {
    long long s = 0;
    long long s2 = 0;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        s = (s * 2 + a[i][j]) % M;
        s2 = (s2 * 2 + a[i][j]) % M2;
      }
    }
    used.insert(s * s2);
    return;
  }
  for (int i = 0; i < N; i++) {
    if (!alloced[i]) {
      for (int j = 0; j < N; j++) {
        if (alloced[j]) {
          a[i][j] = a[j][i] = alloced[i] = 1;
          gen(v - 1);
          a[i][j] = a[j][i] = alloced[i] = 0;
        }
      }
    }
  }
}
int graphs(int existing, int toadd) {
  if (toadd == 0) {
    return 1;
  }
  return mul(existing, power(toadd + existing, toadd - 1));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      a[i][j] = 0;
    }
  }
  memset(alloced, 0, sizeof(alloced));
  for (int i = 0; i < existing - 1; i++) {
    a[i][i + 1] = 1;
    a[i + 1][i] = 1;
    alloced[i] = 1;
    alloced[i + 1] = 1;
  }
  N = existing + toadd;
  used.clear();
  gen(toadd);
  cerr << used.size() << " " << existing * power(toadd + existing, toadd - 1)
       << endl;
  return used.size();
}
int solve(int n, int k) {
  return mul(
      mul(mul(mul(c(n - 2, k), fact(k)), c(m - 1, k)), power(m, n - k - 2)),
      graphs(k + 2, n - k - 2));
}
int main() {
  f[0] = 1;
  for (int i = 1; i < 2000000; i++) {
    f[i] = mul(f[i - 1], i);
  }
  cin >> n >> m;
  int ans = 0;
  for (int k = 0; k <= n - 2 && k < m; k++) {
    ans = (ans + solve(n, k)) % M;
  }
  cout << ans << endl;
  return 0;
}