#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const int maxn = 255;
const long long mod = 1e9 + 7;
long long fac[maxn], ifac[maxn];
long long modpow(long long, long long);
long long inv(long long);
long long nck(long long, long long);
void build();
void testlib();
int n, k;
long long dp[maxn][maxn];
long long K[maxn];
long long K_1[maxn];
long long P2[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  build();
  cin >> n >> k;
  K[0] = K_1[0] = P2[0] = 1;
  for (int i = 1; i < maxn; i++) {
    K[i] = 1LL * k * K[i - 1] % mod;
    K_1[i] = 1LL * (k - 1) * K_1[i - 1] % mod;
    P2[i] = 2LL * P2[i - 1] % mod;
  }
  dp[0][0] = 1;
  for (int j = 1; j <= n; j++) {
    dp[1][j] = nck(n, j) * K_1[n - j] % mod;
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      dp[i][j] = (K[j] - K_1[j]) * K_1[n - j] % mod * dp[i - 1][j] % mod;
      for (int jj = 1; jj < j; jj++) {
        int c0 = j - jj;
        long long cur = nck(n - jj, c0) * K[jj] % mod * K_1[n - j] % mod;
        cur *= dp[i - 1][jj];
        cur %= mod;
        dp[i][j] += cur;
        dp[i][j] %= mod;
      }
    }
  }
  dp[n][n] %= mod;
  dp[n][n] += mod;
  dp[n][n] %= mod;
  cout << dp[n][n] << endl;
  return 0;
}
long long modpow(long long x, long long y) {
  x %= mod;
  long long res = 1;
  while (y > 0) {
    if (y % 2 == 1) {
      res *= x;
      res %= mod;
    }
    x = x * x;
    x %= mod;
    y = y / 2;
  }
  return res;
}
long long inv(long long x) {
  assert(x != 0);
  return modpow(x, mod - 2);
}
void build() {
  fac[0] = ifac[0] = 1;
  for (int i = 1; i < maxn; i++) {
    fac[i] = fac[i - 1] * i;
    fac[i] %= mod;
    ifac[i] = inv(fac[i]);
    ifac[i] %= mod;
  }
}
long long nck(long long n, long long k) {
  assert(n >= 0 && k >= 0);
  if (k > n) return 0;
  return (((fac[n] * ifac[k]) % mod) * ifac[n - k]) % mod;
}
void testlib() {
  assert(modpow(1, 1) == 1);
  assert(modpow(4, 2) == 16);
  assert(modpow(2, 5) == 32);
  assert(fac[3] == 6);
  assert(nck(4, 2) == 6);
  assert(nck(10, 2) == 45);
}
