#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dp[255][255], fac[255], inv[255], powK[255], powKK[255];
long long n, K;
long long power(long long a, long long b) {
  if (!b) return 1;
  long long ret = power(a, b >> 1);
  if (b & 1) return ret * ret % mod * a % mod;
  return ret * ret % mod;
}
long long findinv(long long a) { return power(a, mod - 2); }
long long C(long long n, long long m) {
  return fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  scanf("%lld%lld", &n, &K);
  fac[0] = powK[0] = powKK[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % mod;
  inv[n] = findinv(fac[n]);
  for (int i = n; i >= 1; --i) inv[i - 1] = inv[i] * i % mod;
  for (int i = 1; i <= n; ++i) {
    powK[i] = powK[i - 1] * K % mod;
    powKK[i] = powKK[i - 1] * (K - 1) % mod;
  }
  for (int i = 1; i <= n; ++i) dp[1][i] = C(n, i) * powKK[n - i] % mod;
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      for (int k = j + 1; k <= n; ++k) {
        dp[i][k] += dp[i - 1][j] * C(n - j, k - j) % mod * powKK[n - k] % mod *
                    powK[j] % mod;
        if (dp[i][k] > mod) dp[i][k] -= mod;
      }
      for (int k = 1; k <= j; ++k) {
        dp[i][j] += dp[i - 1][j] * C(j, k) % mod * powKK[n - k] % mod;
        if (dp[i][j] > mod) dp[i][j] -= mod;
      }
    }
  }
  printf("%lld\n", dp[n][n]);
}
