#include <bits/stdc++.h>
using namespace std;
const int ms = 255;
const int mod = int(1e9) + 7;
long long dp[ms][ms], n, k, fat[ms], potk[ms], potk1[ms], comb[ms][ms];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> k;
  fat[0] = potk[0] = potk1[0] = 1;
  for (int i = 1; i < ms; i++) {
    fat[i] = fat[i - 1] * i % mod;
    potk[i] = potk[i - 1] * k % mod;
    potk1[i] = potk1[i - 1] * (k - 1) % mod;
  }
  for (int i = 0; i < ms; i++)
    for (int j = 0; j <= i; j++) {
      if (i == 0 || j == 0)
        comb[i][j] = 1;
      else
        comb[i][j] = (comb[i - 1][j] + comb[i - 1][j - 1]) % mod;
    }
  for (int r = 1; r <= n; r++)
    for (int c = 0; c <= n; c++) {
      if (r == 1 && c == 0)
        dp[r][c] = (potk[n] - potk1[n] + mod) % mod;
      else if (r == 1)
        dp[r][c] = potk[n - c];
      else {
        dp[r][c] = (potk1[c] * (potk[n - c] - potk1[n - c] + mod) % mod) *
                   dp[r - 1][c] % mod;
        for (int i = 1; i <= c; i++) {
          dp[r][c] += (potk[n - c] * comb[c][i] % mod) *
                      (potk1[c - i] * dp[r - 1][c - i] % mod) % mod;
          dp[r][c] %= mod;
        }
      }
    }
  cout << dp[n][n] << endl;
  return 0;
}
