#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-6;
const unsigned long long hashp = 1e7 + 19;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 250 + 100;
int jc[maxn] = {1}, inv[maxn];
int dp[maxn][maxn], C[maxn][maxn], pw[maxn][2];
int qpow(int a, int b) {
  int ret = 1;
  a %= mod;
  while (b) {
    if (b & 1) ret = 1LL * ret * a % mod;
    b >>= 1;
    a = 1LL * a * a % mod;
  }
  return ret;
}
int c(int n, int m) { return 1LL * jc[n] * inv[m] % mod * inv[n - m] % mod; }
void init(int k) {
  for (int i = 1; (i) <= (300); i++) jc[i] = 1LL * jc[i - 1] * i % mod;
  inv[300] = qpow(jc[300], mod - 2);
  for (int i = 299; i >= 0; i--) inv[i] = 1LL * inv[i + 1] * (i + 1) % mod;
  for (int i = 0; (i) < (301); i++)
    for (int j = 0; (j) < (i + 1); j++) C[i][j] = c(i, j);
  for (int i = 0; (i) < (301); i++) {
    pw[i][0] = qpow(k, i);
    pw[i][1] = qpow(k - 1, i);
  }
}
void add(int &x, int y) {
  x += y;
  x -= (x >= mod) ? mod : 0;
}
void solve() {
  int n, k;
  scanf("%d%d", &n, &k);
  init(k);
  dp[0][n] = 1;
  for (int i = 1; (i) <= (n); i++) {
    for (int j = 0; (j) < (n + 1); j++) {
      dp[i][j] = 1LL * dp[i - 1][j] *
                 ((pw[n - j][0] - pw[n - j][1] + mod) % mod) % mod * pw[j][1] %
                 mod;
      for (int u = j + 1; u <= n; u++)
        add(dp[i][j], 1LL * dp[i - 1][u] * C[u][u - j] % mod * pw[j][1] % mod *
                          pw[n - u][0] % mod);
    }
  }
  cout << dp[n][0] << endl;
}
int main() {
  solve();
  return 0;
}
