#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7, C[255][255];
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b = b / 2;
  }
  return res % mod;
}
int main() {
  long long res = 0, n, k;
  cin >> n >> k;
  for (int i = 0; i <= 250; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) {
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
    }
  }
  for (int i = 0; i <= n; i++) {
    res =
        (res + qpow(-1, i) % mod * C[n][i] % mod * qpow(k - 1, n * i) % mod *
                   qpow((qpow(k, n - i) - qpow(k - 1, n - i) + mod) % mod, n)) %
        mod;
  }
  cout << (res % mod + mod) % mod;
}
