#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int mx = 255;
long long ncr[mx][mx], dp[mx][mx], n, k, po[mx], po2[mx];
long long call(int row, int one) {
  if (row > n) return one == n ? 1 : 0;
  long long &ret = dp[row][one];
  if (~ret) return ret;
  ret = 0;
  int rem = n - one;
  for (int i = 1; i <= one; i++)
    ret = (ret + ncr[one][i] * po2[n - i] % mod * call(row + 1, one)) % mod;
  for (int i = 1; i <= rem; i++)
    ret = (ret + ncr[rem][i] * po2[rem - i] % mod * po[one] % mod *
                     call(row + 1, one + i)) %
          mod;
  return ret;
}
int main() {
  ncr[0][0] = 1;
  for (int i = 1; i <= 250; i++) {
    ncr[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      ncr[i][j] = (ncr[i - 1][j] + ncr[i - 1][j - 1]) % mod;
    }
  }
  cin >> n >> k;
  po[0] = po2[0] = 1;
  for (int i = 1; i <= 250; i++) {
    po[i] = po[i - 1] * k % mod;
    po2[i] = po2[i - 1] * (k - 1) % mod;
  }
  memset(dp, -1, sizeof dp);
  cout << call(1, 0) << endl;
  return 0;
}
