#include <bits/stdc++.h>
using namespace std;
const int maxn = 270;
const long long MOD = 1e9 + 7;
long long f[maxn][maxn];
long long pw_k[maxn], pw_k2[maxn];
long long Pow(long long x, long long n) {
  long long ans = 1, base = x % MOD;
  while (n) {
    if (n & 1) ans = ans * base % MOD;
    base = base * base % MOD;
    n >>= 1;
  }
  return ans;
}
long long fact[maxn], inv[maxn];
void init(int n) {
  fact[0] = 1;
  for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i % MOD;
  inv[n] = Pow(fact[n], MOD - 2);
  for (int i = n - 1; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % MOD;
}
long long C(int n, int k) {
  if (k > n) return 0;
  return fact[n] * inv[k] % MOD * inv[n - k] % MOD;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  init(n);
  pw_k[0] = pw_k2[0] = 1;
  for (int i = 1; i <= n; ++i) {
    pw_k[i] = pw_k[i - 1] * k % MOD;
    pw_k2[i] = pw_k2[i - 1] * (k - 1) % MOD;
  }
  for (int i = 1; i <= n; ++i) f[1][i] = C(n, i) * Pow(k - 1, n - i) % MOD;
  for (int i = 1; i < n; ++i) {
    for (int j = 1; j <= n; ++j) {
      f[i + 1][j] = (f[i + 1][j] + f[i][j] * (Pow(k, j) - Pow(k - 1, j)) % MOD *
                                       Pow(k - 1, n - j) % MOD) %
                    MOD;
      for (int l = 1; l <= n - j; ++l) {
        f[i + 1][j + l] =
            (f[i + 1][j + l] + f[i][j] * C(n - j, l) % MOD * pw_k[j] % MOD *
                                   pw_k2[n - l - j] % MOD) %
            MOD;
      }
    }
  }
  if (f[n][n] < 0) f[n][n] += MOD;
  printf("%lld\n", f[n][n]);
  return 0;
}
