#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 255;
long long fac[maxn], inv[maxn], power_k[maxn], power_k_1[maxn], dp[maxn][maxn];
long long fast(long long x, long long y = mod - 2) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
void init(int n, int k) {
  fac[0] = 1;
  power_k[0] = power_k_1[0] = 1;
  for (int i = 1; i <= n; i++) {
    fac[i] = fac[i - 1] * i % mod;
    power_k[i] = power_k[i - 1] * k % mod;
    power_k_1[i] = power_k_1[i - 1] * (k - 1) % mod;
  }
  inv[n] = fast(fac[n]);
  for (int i = n - 1; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
}
long long C(int n, int m) { return fac[n] * inv[m] % mod * inv[n - m] % mod; }
int main() {
  int n, K;
  scanf("%d%d", &n, &K);
  init(n, K);
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= n; j++) {
      if (dp[i][j] == 0) continue;
      for (int k = 0; k <= n - j; k++) {
        if (k == 0)
          dp[i + 1][j + k] =
              ((dp[i + 1][j + k] - dp[i][j] * power_k_1[n]) % mod + mod) % mod;
        dp[i + 1][j + k] =
            (dp[i + 1][j + k] + dp[i][j] * C(n - j, k) % mod * power_k[j] %
                                    mod * power_k_1[n - j - k] % mod) %
            mod;
      }
    }
  }
  cout << dp[n][n] << endl;
  return 0;
}
