#include <bits/stdc++.h>
using namespace std;
const int N = 250 + 10;
const long long MOD = 1000000000 + 7;
const long long INF = 1000000000000000000;
long long dp[N][N];
long long n, k, tavk[N], tavk2[N], ent[N][N];
long long mul(long long a, long long b) { return (a * b) % MOD; }
long long f[N], inv[N];
long long POW(long long x, long long t) {
  if (t == 0) return 1;
  if (t % 2 == 0) return POW(x * x % MOD, t / 2);
  return x * POW(x, t - 1) % MOD;
}
long long nCr(long long x, long long y) {
  if (y > x || y < 0 || x < 0) return 0;
  return mul(f[x], mul(inv[y], inv[x - y]));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  dp[0][0] = 1;
  f[0] = 1;
  inv[0] = 1;
  for (int i = 1; i < N; i++) {
    f[i] = mul(f[i - 1], i);
    inv[i] = POW(f[i], MOD - 2);
  }
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) ent[i][j] = nCr(i, j);
  tavk[0] = 1, tavk2[0] = 1;
  ;
  for (int i = 1; i < N; i++) tavk[i] = mul(tavk[i - 1], k);
  for (int i = 1; i < N; i++) tavk2[i] = mul(tavk2[i - 1], k - 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      dp[i][j] = mul(dp[i - 1][j], mul(tavk2[n - j], tavk[j] - tavk2[j]));
      for (int kk = 0; kk < j; kk++) {
        dp[i][j] += mul(dp[i - 1][kk],
                        mul(ent[n - kk][j - kk], mul(tavk[kk], tavk2[n - j])));
      }
      dp[i][j] %= MOD;
    }
  }
  cout << dp[n][n] % MOD;
  return 0;
}
