#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1000000007;
int n, m;
int64_t DP[256][256];
int64_t C[256][256];
int64_t Pow(int64_t k, int64_t n) {
  int64_t v = k;
  int64_t result = 1;
  for (int64_t i = 0; i < 63; ++i) {
    if (n & (1ll << i)) {
      result = result * v % MOD;
    }
    v = v * v % MOD;
  }
  return result;
}
int64_t POW[2][256];
int main() {
  scanf("%d%d", &n, &m);
  if (1 == m) {
    puts("1");
    return 0;
  }
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= i; ++j)
      C[i][j] = i == j || j == 0 ? 1 : (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
    POW[0][i] = Pow(m, i);
    POW[1][i] = Pow(m - 1, i);
  }
  for (int j = 1; j <= n; ++j) {
    DP[1][j] = C[n][j] * POW[1][n - j] % MOD;
  }
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      for (int k = 0; j + k <= n; ++k) {
        DP[i][j + k] += DP[i - 1][j] * C[n - j][k] % MOD *
                        (k ? POW[0][j] : (POW[0][j] - POW[1][j] + MOD) % MOD) %
                        MOD * POW[1][n - j - k] % MOD;
        DP[i][j + k] %= MOD;
      }
    }
  }
  printf("%lld\n", DP[n][n]);
}
