#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}};
constexpr int N_MAX = 250;
ll n, k;
ll fact[N_MAX + 1], rfact[N_MAX + 1];
vector<ll> kpow(N_MAX + 1, 1), k1pow(N_MAX + 1, 1);
inline ll perm(ll n, ll r) { return (fact[n] * rfact[r]) % MOD; }
inline ll comb(ll n, ll r) { return (perm(n, r) * rfact[n - r]) % MOD; }
inline void init(ll n) {
  for (int i = 1; i <= n; ++i) {
    kpow[i] = (kpow[i - 1] * k) % MOD;
    k1pow[i] = (k1pow[i - 1] * (k - 1)) % MOD;
  }
  fact[0] = fact[1] = 1;
  rfact[0] = rfact[1] = 1;
  for (int i = 2; i <= n; ++i) {
    fact[i] = (fact[i - 1] * (ll)i) % MOD;
    rfact[i] = 1;
    ll k = MOD - 2;
    ll a = fact[i];
    while (k > 0) {
      if (k & 1) {
        rfact[i] *= a;
        rfact[i] %= MOD;
      }
      a *= a;
      a %= MOD;
      k >>= 1;
    }
  }
}
inline ll modpow(ll a, ll t) {
  if (a == k) {
    return kpow[t];
  } else if (a == k - 1) {
    return k1pow[t];
  }
  ll ret = 1LL;
  while (t) {
    if (t & 1LL) {
      ret *= a;
      ret %= MOD;
    }
    a *= a;
    a %= MOD;
    t >>= 1;
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> k;
  init(n);
  vector<vector<ll>> dp(n, vector<ll>(n + 1, 0));
  for (int j = 1; j <= n; ++j) {
    dp[0][j] = (comb(n, j) * modpow(k - 1, n - j)) % MOD;
  }
  for (int i = 1; i < n; ++i) {
    for (int j = 1; j <= n; ++j) {
      for (int j_ = 1; j_ <= j; ++j_) {
        dp[i][j] += (((dp[i - 1][j_] * comb(n - j_, j - j_)) % MOD) *
                     ((modpow(k, j_) * modpow(k - 1, n - j)) % MOD)) %
                    MOD;
        dp[i][j] %= MOD;
      }
      dp[i][j] += MOD - ((dp[i - 1][j] * modpow(k - 1, n)) % MOD);
      dp[i][j] %= MOD;
    }
  }
  cout << dp[n - 1][n] << endl;
}
