#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using ll = long long;
const int M = 1e9 + 7;
struct mint {
  int x;
  mint(int _x = 0) : x(_x) {}
  operator int() { return x; }
  mint operator+(mint o) { return x + o.x >= M ? x + o.x - M : x + o.x; }
  mint operator-(mint o) { return x - o.x < 0 ? x - o.x + M : x - o.x; }
  mint operator*(mint o) { return (ll)x * o.x % M; }
  mint operator^(int e) {
    if (e == 0) return 1;
    mint q = (*this) ^ (e / 2);
    return e % 2 == 1 ? q * q * (*this) : q * q;
  }
};
istream &operator>>(istream &i, mint &m) {
  i >> m.x;
  return i;
}
const int N = 250;
int n;
mint k;
mint comb[N + 1][N + 1];
void calc_comb() {
  comb[0][0] = 1;
  for (int i = int(1); i < int(N + 1); i++) {
    comb[i][0] = comb[i][i] = 1;
    for (int j = int(1); j < int(i); j++)
      comb[i][j] = comb[i - 1][j] + comb[i - 1][j - 1];
  }
}
const mint one = 1;
mint potk[N + 1], potk1[N + 1];
void calc_pots() {
  potk[0] = one;
  for (int i = int(1); i < int(N + 1); i++) potk[i] = potk[i - 1] * k;
  mint k1 = k - one;
  potk1[0] = one;
  for (int i = int(1); i < int(N + 1); i++) potk1[i] = potk1[i - 1] * k1;
}
mint memo[N][N + 1];
mint dp(int col = 0, int rows_done = 0) {
  if (col == n) return rows_done == n;
  mint &res = memo[col][rows_done];
  if (res != -1) return res;
  res = 0;
  int rows_rem = n - rows_done;
  for (int ones = int(1); ones < int(rows_rem + 1); ones++) {
    mint ways = comb[rows_rem][ones] * potk1[rows_rem - ones] * potk[rows_done];
    res = res + dp(col + 1, rows_done + ones) * ways;
  }
  mint ways = (potk[rows_done] - potk1[rows_done]) * potk1[rows_rem];
  res = res + dp(col + 1, rows_done) * ways;
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  fill(memo[0], memo[N], -1);
  calc_comb();
  cin >> n >> k;
  calc_pots();
  cout << dp() << '\n';
  return 0;
}
