#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000000 + 7;
int dp[251][251] = {};
int f[251];
int nck[251][251];
int pk[251], pkMinus[251];
inline int power(int a, int b, int c) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = ans * (long long)a % c;
    a = a * (long long)a % c;
    b /= 2;
  }
  return ans;
}
inline int ncr(int n, int r) {
  int ans = f[n];
  ans = ans * (long long)power(f[r], MOD - 2, MOD) % MOD;
  ans = ans * (long long)power(f[n - r], MOD - 2, MOD) % MOD;
  return ans;
}
int solve(int r, int c, int n, int k) {
  if (r == 0) return c == 0;
  if (c == 0) {
    int ans = power((pk[n] - pkMinus[n] + MOD) % MOD, r, MOD);
    return ans;
  }
  int& ans = dp[r][c];
  if (ans != -1) return ans;
  ans = 0;
  for (int i = (1); i < (c + 1); i += (1)) {
    int fact = pk[n - c] * (long long)nck[c][i] % MOD *
               (long long)pkMinus[c - i] % MOD;
    int rec = solve(r - 1, c - i, n, k);
    ans += fact * (long long)rec % MOD;
    ans %= MOD;
  }
  ans += (pk[n - c] - pkMinus[n - c] + MOD) % MOD * (long long)pkMinus[c] %
         MOD * (long long)solve(r - 1, c, n, k) % MOD;
  ans %= MOD;
  return ans;
}
int main() {
  int n = ({
    int x;
    scanf("%d", &x);
    x;
  }),
      k = ({
        int x;
        scanf("%d", &x);
        x;
      });
  f[0] = 1;
  for (int i = (0); i < (250); i += (1)) f[i + 1] = f[i] * (i + 1LL) % MOD;
  for (int i = (1); i < (251); i += (1))
    for (int j = (1); j < (i + 1); j += (1)) {
      nck[i][j] = ncr(i, j);
    }
  pk[0] = pkMinus[0] = 1;
  for (int i = (1); i < (251); i += (1)) {
    pk[i] = pk[i - 1] * (long long)k % MOD;
    pkMinus[i] = pkMinus[i - 1] * (long long)(k - 1) % MOD;
  }
  for (int i = (0); i < (251); i += (1))
    for (int j = (0); j < (251); j += (1)) dp[i][j] = -1;
  cout << solve(n, n, n, k) << "\n";
}
