#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long dp[255][255];
long long p[255], q[255], C[255][255];
int N;
long long K;
void init() {
  cin >> N >> K;
  p[0] = q[0] = C[0][0] = 1;
  for (int i = 1; i <= 250; i++) {
    p[i] = p[i - 1] * K % MOD;
    q[i] = q[i - 1] * (K - 1) % MOD;
    C[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
    }
  }
}
void solve() {
  dp[0][0] = 1;
  for (int r = 1; r <= N; r++) {
    for (int c = 1; c <= N; c++) {
      for (int a = 0; a <= c; a++) {
        if (a == c) {
          dp[r][c] = (dp[r][c] + ((p[c] + MOD - q[c]) * q[N - c] % MOD *
                                  dp[r - 1][c] % MOD)) %
                     MOD;
        } else {
          dp[r][c] = (dp[r][c] + (C[N - a][c - a] * p[a] % MOD * q[N - c] %
                                  MOD * dp[r - 1][a] % MOD)) %
                     MOD;
        }
      }
    }
  }
  cout << dp[N][N] << "\n";
}
int main() {
  init();
  solve();
}
