#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, k;
long long dp[255][255];
long long cnt[255][255];
long long f[255];
long long g[255];
long long h[255];
long long cal(int r, int c) {
  if (dp[r][c]) return dp[r][c];
  if (c == 0) {
    dp[r][c] = h[r];
    return dp[r][c];
  }
  if (r == 1) {
    dp[r][c] = f[n - c];
    return dp[r][c];
  }
  dp[r][c] = (f[n - c] - g[n - c]) * g[c] % mod;
  dp[r][c] = dp[r][c] * cal(r - 1, c) % mod;
  for (int i = 1; i <= c; i++) {
    long long tmp = f[n - c] * g[c - i] % mod;
    tmp = tmp * cnt[c][i] % mod;
    tmp = tmp * cal(r - 1, c - i) % mod;
    dp[r][c] = (dp[r][c] + tmp) % mod;
  }
  dp[r][c] += mod;
  dp[r][c] %= mod;
  return dp[r][c];
}
int main() {
  cin >> n >> k;
  cnt[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    cnt[i][0] = 1;
    for (int j = 1; j <= n; j++)
      cnt[i][j] = (cnt[i - 1][j] + cnt[i - 1][j - 1]) % mod;
  }
  f[0] = g[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = f[i - 1] * k % mod;
    g[i] = g[i - 1] * (k - 1) % mod;
  }
  h[0] = 1;
  for (int i = 1; i <= n; i++) {
    h[i] = h[i - 1] * (f[n] - g[n]) % mod;
    h[i] += mod;
    h[i] %= mod;
  }
  cout << cal(n, n) << endl;
}
