#include <bits/stdc++.h>
using namespace std;
const int N = 251;
const long long mod = 1e9 + 7;
long long n, k;
long long dp[N][N];
long long jc[N], njc[N];
long long kkpow(long long r, int t) {
  long long ret = 1;
  while (t) {
    if (t & 1) ret = ret * r % mod;
    r = r * r % mod;
    t >>= 1;
  }
  return ret;
}
long long cb(int x, int y) { return jc[x] * njc[y] % mod * njc[x - y] % mod; }
long long ksm[2][N];
long long kpow(long long r, int t) {
  r -= k - 1;
  return ksm[r][t];
}
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  jc[0] = njc[0] = 1;
  n = N;
  for (int i = (1); i < (n + 1); i++) jc[i] = jc[i - 1] * i % mod;
  njc[n] = kkpow(jc[n], mod - 2);
  for (int i = (n)-1; i >= (1); --i) njc[i] = njc[i + 1] * (i + 1) % mod;
  while (cin >> n >> k) {
    ksm[0][0] = ksm[1][0] = 1;
    for (int i = (0); i < (2); i++)
      for (int j = (1); j < (n + 1); j++)
        ksm[i][j] = ksm[i][j - 1] * (k - 1 + i) % mod;
    for (int j = (1); j < (n + 1); j++)
      dp[1][j] = kpow(k - 1, n - j) * cb(n, n - j) % mod;
    for (int i = (2); i < (n + 1); i++)
      for (int j = (1); j < (n + 1); j++) {
        dp[i][j] = 0;
        for (int l = (1); l < (j + 1); l++) {
          dp[i][j] += dp[i - 1][l] * kpow(k, l) % mod * kpow(k - 1, n - j) %
                      mod * cb(n - l, n - j) % mod;
          dp[i][j] %= mod;
        }
        dp[i][j] -= dp[i - 1][j] * kpow(k - 1, n) % mod;
        if (dp[i][j] < 0) dp[i][j] += mod;
      }
    cout << dp[n][n] << '\n';
  }
  return 0;
}
