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;
char string_in_buffer[(int)260];
void fast_scan(int &first) { scanf("%d", &first); }
void fast_scan(long long &first) { scanf("%lld", &first); }
void fast_scan(unsigned long long &first) { scanf("%llu", &first); }
void fast_scan(double &first) { scanf("%lf", &first); }
void fast_scan(long double &first) { scanf("%Lf", &first); }
void fast_scan(char &first) {
  scanf("%c", &first);
  if (first == '\n') {
    fast_scan(first);
  }
}
void fast_scan(string &first) {
  scanf("%s", string_in_buffer);
  first = string(string_in_buffer);
}
template <class TFirst, class TSecond>
void fast_scan(pair<TFirst, TSecond> &p) {
  fast_scan(p.first);
  fast_scan(p.second);
}
template <class T>
void fast_scan(vector<T> &v) {
  for (auto &first : v) fast_scan(first);
}
void fast_print(const int &first) { printf("%d", first); }
void fast_print(const unsigned int &first) { printf("%u", first); }
void fast_print(const long long &first) { printf("%lld", first); }
void fast_print(const unsigned long long &first) { printf("%llu", first); }
void fast_print(const double &first) { printf("%.15lf", first); }
void fast_print(const long double &first) { printf("%.15Lf", first); }
void fast_print(const char &first) { printf("%c", first); };
void fast_print(const string &first) { printf("%s", first.c_str()); }
void fast_print(const char v[]) { fast_print((string)v); }
template <class TFirst, class TSecond>
void fast_print(const pair<TFirst, TSecond> &p) {
  fast_print(p.first);
  fast_print(' ');
  fast_print(p.second);
}
template <class T>
void fast_print(const vector<T> &v) {
  if (v.empty()) return;
  fast_print(v[0]);
  for (int i = 1; i < v.size(); i++) {
    fast_print(' ');
    fast_print(v[i]);
  }
}
template <class T>
void fast_print(const vector<vector<T>> &v) {
  if (v.empty()) return;
  fast_print(v[0]);
  for (int i = 1; i < v.size(); i++) {
    fast_print('\n');
    fast_print(v[i]);
  }
}
template <class T>
void fast_print(const T &v) {
  for (const auto &first : v) {
    fast_print(first);
    fast_print(' ');
  }
}
using namespace std;
namespace smart_io {
string print_start = "";
string sep = " ";
bool first_print = false;
void precall_print() {
  fast_print(print_start);
  print_start = "\n";
  first_print = true;
}
void _print(deque<string>) {}
template <class T, class... Args>
void _print(deque<string> names, T elem, Args... args) {
  if (!first_print) {
    fast_print("\n");
  } else {
    first_print = false;
  }
  fast_print(names.front());
  fast_print(" = ");
  fast_print(elem);
  names.pop_front();
  _print(names, args...);
}
}  // namespace smart_io
template <class T>
ostream &operator,(ostream &os, const T &object) {
  if (!smart_io::first_print) {
    fast_print(smart_io::sep);
  } else {
    smart_io::first_print = false;
  }
  fast_print(object);
  return os;
}
template <class T>
istream &operator,(istream &is, T &object) {
  fast_scan(object);
  return is;
}
namespace escape__from__random__aetuhoetnuhshe {
using namespace std::chrono;
mt19937 rng(duration_cast<milliseconds>(system_clock::now().time_since_epoch())
                .count());
uniform_real_distribution<> prob_dist(0.0, 1.0);
};  // namespace escape__from__random__aetuhoetnuhshe
namespace typedefs {}
namespace numbers_operation {
template <class T>
T floor_mod(T a, T b) {
  if (a >= 0 && b >= 0) return a % b;
  if (a <= 0 && b <= 0) return a % b;
  return abs(b) - (abs(a) % abs(b));
}
}  // namespace numbers_operation
using namespace numbers_operation;
using namespace typedefs;
using namespace escape__from__random__aetuhoetnuhshe;
const long long MOD = 1e9 + 7;
template <long long MOD>
struct Ring {
  long long value = 0;
  Ring() {}
  Ring(int _value) {
    value = _value;
    value = floor_mod(value, MOD);
  }
  Ring(long long _value) {
    value = _value;
    value = floor_mod(value, MOD);
  }
  Ring pow(const long long &p) const {
    if (p < 0) return 0;
    if (p == 0) return 1;
    if (p & 1) {
      return Ring(value).pow(p - 1) * value;
    } else {
      Ring sub = Ring(value).pow(p / 2);
      return sub * sub;
    }
  }
  Ring inv() const { return pow(MOD - 2); }
  void operator*=(const Ring<MOD> &b) {
    value *= b.value;
    value = floor_mod(value, MOD);
  }
  friend Ring operator*(Ring<MOD> a, const Ring<MOD> &b) {
    a *= b;
    return a;
  }
  void operator+=(const Ring<MOD> &b) {
    value += b.value;
    value = floor_mod(value, MOD);
  }
  friend Ring operator+(Ring a, const Ring &b) {
    a += b;
    return a;
  }
  void operator-=(const Ring<MOD> &b) {
    value -= b.value;
    value = floor_mod(value, MOD);
  }
  friend Ring operator-(Ring a, const Ring &b) {
    a -= b;
    return a;
  }
  void operator/=(const Ring<MOD> &b) { (*this) *= b.inv(); }
  friend Ring operator/(Ring a, const Ring &b) {
    a /= b;
    return a;
  }
  bool operator==(const Ring<MOD> &b) { return value == b.value; }
  friend void fast_print(const Ring<MOD> &b) { fast_print(b.value); }
};
vector<Ring<MOD>> fact;
vector<Ring<MOD>> invfact;
Ring<MOD> binom(int n, int k) { return fact[n] / (fact[n - k] * fact[k]); }
signed main(signed argc, char *argv[]) {
  fact.push_back(1);
  invfact.push_back(1);
  for (int i = 1; i < (int)1e6 + 100; i++) {
    fact.push_back(Ring<MOD>(i) * fact.back());
    invfact.push_back(fact.back().inv());
  }
  int n, m;
  cin, n, m;
  Ring<MOD> rez = 0;
  Ring<MOD> A = Ring<MOD>(n).pow(n - 2);
  Ring<MOD> NINV = Ring<MOD>(n).inv();
  Ring<MOD> B = Ring<MOD>(m).pow(n - 1);
  Ring<MOD> MINV = Ring<MOD>(m).inv();
  for (int l = 1; l < n; l++) {
    if (l > m) continue;
    A *= NINV;
    B *= MINV;
    if (l == n - 1) {
      rez += binom(n - 2, l - 1) * binom(m - 1, l - 1) * fact[l - 1];
    } else {
      Ring<MOD> linv = invfact[l - 1];
      rez += (fact[n - 2] * linv * invfact[n - 2 - (l - 1)]) *
             (fact[m - 1] * linv * invfact[m - 1 - (l - 1)]) * (l + 1) * A * B *
             fact[l - 1];
    }
  }
  smart_io::precall_print();
  cout, rez;
}