#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
const int MAXN = 255;
const int MOD = 1e9 + 7;
namespace modOp {
int ad(int a, int b, int mod = MOD) { return (a + b) % mod; }
int sub(int a, int b, int mod = MOD) { return (a - b + mod) % mod; }
int mul(int a, int b, int mod = MOD) { return (ll)a * b % mod; }
int AD(int &a, int b, int mod = MOD) { return a = ad(a, b, mod); }
int SUB(int &a, int b, int mod = MOD) { return a = sub(a, b, mod); }
int MUL(int &a, int b, int mod = MOD) { return a = mul(a, b, mod); }
int po(int b, int p, int mod = MOD) {
  return !p ? 1 : mul(po(mul(b, b, mod), p / 2, mod), p & 1 ? b : 1, mod);
}
int inv(int b, int mod = MOD) { return po(b, mod - 2, mod); }
int invGeneral(int a, int b) {
  if (a == 0) return b == 1 ? 0 : -1;
  int x = invGeneral(b % a, a);
  return x == -1 ? -1 : ((1 - (ll)b * x) / a + b) % b;
}
}  // namespace modOp
using namespace modOp;
int n, k;
ll dp[MAXN][MAXN], pk[MAXN], pl[MAXN];
ll fact[MAXN];
ll C[MAXN][MAXN];
signed main() {
  cin >> n >> k;
  pl[0] = pk[0] = fact[0] = 1;
  for (int i = 1; i <= n; i++) {
    fact[i] = mul(fact[i - 1], i);
    pk[i] = mul(pk[i - 1], k);
    pl[i] = mul(pl[i - 1], k - 1);
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= i; j++) {
      C[i][j] = mul(fact[i], inv(mul(fact[j], fact[i - j])));
    }
  for (int i = 1; i <= n; i++) {
    dp[i][0] = po(sub(pk[n], pl[n]), i);
  }
  for (int j = 1; j <= n; j++) {
    dp[1][j] = pk[n - j];
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      ll q = 1;
      q = (q * dp[i - 1][j]) % MOD;
      q = (q * ((pk[n - j] - pl[n - j] + MOD) % MOD)) % MOD;
      q = (q * pl[j]) % MOD;
      dp[i][j] = q;
      for (int l = 1; l <= j; l++) {
        ll w = 1;
        w = (w * pk[n - j]) % MOD;
        w = (w * C[j][l]) % MOD;
        w = (w * pl[j - l]) % MOD;
        w = (w * dp[i - 1][j - l]) % MOD;
        dp[i][j] = ((ll)dp[i][j] + w) % MOD;
      }
    }
  }
  cout << dp[n][n] << endl;
}
