#include <bits/stdc++.h>
using namespace std;
const int dr[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dc[] = {0, -1, 0, 1, -1, 1, -1, 1};
const int MOD = int(1e9) + 7;
const int N = 260;
long long qpow(long long x, long long pw) {
  long long ans = 1;
  while (pw) {
    if (pw & 1) ans = ans * x % MOD;
    x = x * x % MOD;
    pw >>= 1;
  }
  return ans;
}
long long dp[N][N], fac[N], rev[N], C[N][N], pnum[N], pnum1[N];
int n, num;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> num;
  fac[0] = 1;
  rev[0] = 1;
  for (int i = 1; i <= n; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    rev[i] = qpow(fac[i], MOD - 2);
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      C[i][j] = fac[i] * rev[j] % MOD * rev[i - j] % MOD;
    }
  }
  pnum[0] = 1;
  for (int i = 1; i <= n; i++) pnum[i] = pnum[i - 1] * num % MOD;
  pnum1[0] = 1;
  for (int i = 1; i <= n; i++) pnum1[i] = pnum1[i - 1] * (num - 1) % MOD;
  for (int i = 1; i <= n; i++) {
    dp[1][i] = C[n][i] * pnum1[n - i] % MOD;
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= j; k++) {
        long long cur;
        if (k < j)
          cur = dp[i - 1][k] * pnum[k] % MOD;
        else
          cur = dp[i - 1][k] * (pnum[k] - pnum1[k] + MOD) % MOD;
        cur = cur * C[n - k][j - k] % MOD;
        cur = cur * pnum1[n - j] % MOD;
        dp[i][j] = (dp[i][j] + cur) % MOD;
      }
    }
  }
  cout << dp[n][n] << '\n';
  return 0;
}
