#include <bits/stdc++.h>
using namespace std;
long long int com[255][255];
long long int dp[255][255];
long long int p1[255], p2[255];
long long int power(long long int x, long long int y) {
  if (y == 0) {
    return 1;
  }
  long long int z = power(x, y / 2);
  z = z * z % 1000000007;
  if (y & 1) {
    z = (z * x) % 1000000007;
  }
  return z;
}
long long int solve(long long int r, long long int c, long long int k,
                    long long int n) {
  if (dp[r][c] != -1) {
    return dp[r][c];
  }
  long long int x, y = 0, z;
  if (c == 0) {
    z = power((p1[n] - p2[n] + 1000000007) % 1000000007, r);
    dp[r][c] = z;
    return z;
  }
  if (r == 1) {
    z = p1[n - c];
    dp[r][c] = z;
    return z;
  }
  x = (((p1[n - c] - p2[n - c] + 1000000007) % 1000000007) *
       solve(r - 1, c, k, n) % 1000000007) *
      p2[c] % 1000000007;
  for (int i = 1; i <= c; i++) {
    y += ((com[c][i] * solve(r - 1, c - i, k, n) % 1000000007) * p2[c - i] %
          1000000007) *
         p1[n - c];
    y %= 1000000007;
  }
  z = (x + y) % 1000000007;
  dp[r][c] = z;
  return z;
}
int main() {
  long long int i, j, k, x, y, idx1, idx2, t, i1, m, z = 0, x1, x2, y1, y2, n;
  scanf("%lld%lld", &n, &k);
  com[0][0] = 1;
  for (i = 1; i < 255; i++) {
    com[i][1] = i;
    com[i][i] = 1;
    for (j = 2; j < i; j++) {
      com[i][j] = (com[i - 1][j] + com[i - 1][j - 1]) % 1000000007;
    }
  }
  for (i = 0; i < 255; i++) {
    for (j = 0; j < 255; j++) {
      dp[i][j] = -1;
    }
  }
  p1[0] = 1;
  p2[0] = 1;
  for (i = 1; i < 255; i++) {
    p1[i] = p1[i - 1] * k % 1000000007;
    p2[i] = p2[i - 1] * (k - 1) % 1000000007;
  }
  long long int ans = solve(n, n, k, n);
  printf("%lld\n", ans);
  ;
}
