#include <bits/stdc++.h>
const int mu = 1000000007, N = 255;
int n, k, pk[N], pk2[N], c[N][N], dp[N][N];
int main() {
  scanf("%d%d", &n, &k);
  pk[0] = 1;
  for (int i = 1; i <= n; i++) pk[i] = 1ll * pk[i - 1] * k % mu;
  pk2[0] = 1;
  for (int i = 1; i <= n; i++) pk2[i] = 1ll * pk2[i - 1] * (k - 1) % mu;
  c[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= n; j++) c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mu;
  }
  dp[0][n] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= n; j++) {
      int t = n - j;
      if (!dp[i - 1][j]) continue;
      dp[i][j] = (dp[i][j] + 1ll * dp[i - 1][j] *
                                 (1ll * pk[t] * pk2[j] % mu + mu - pk2[n])) %
                 mu;
      for (int k = 1; k <= j; k++)
        dp[i][j - k] = (dp[i][j - k] + dp[i - 1][j] * 1ll * c[j][k] % mu *
                                           pk[t] % mu * pk2[j - k]) %
                       mu;
    }
  printf("%d\n", dp[n][0]);
}
