#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll combinations[251][251];
ll pow_k[251];
ll pow_k_1[251];
ll dp[251][251];
int main() {
  for (int i = 0; i < 251; ++i) combinations[i][0] = 1;
  for (int i = 1; i < 251; ++i) {
    for (int j = 1; j < 251; ++j) {
      combinations[i][j] =
          (combinations[i - 1][j] + combinations[i - 1][j - 1]) % 1000000007;
    }
  }
  int n, k;
  cin >> n >> k;
  pow_k[0] = pow_k_1[0] = 1;
  for (int i = 1; i < 251; ++i) {
    pow_k[i] = (pow_k[i - 1] * k) % 1000000007;
    pow_k_1[i] = (pow_k_1[i - 1] * (k - 1)) % 1000000007;
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int l = 0; l <= j; l++) {
        if (j == l) {
          dp[i][j] =
              (dp[i][j] + ((dp[i - 1][l] *
                            (1000000007 + pow_k[j] - pow_k_1[j]) % 1000000007) %
                           1000000007 * pow_k_1[n - j]) %
                              1000000007) %
              1000000007;
        } else {
          dp[i][j] = (dp[i][j] + (((((dp[i - 1][l] * pow_k[l]) % 1000000007) *
                                    combinations[n - l][j - l]) %
                                   1000000007) *
                                  pow_k_1[n - j] % 1000000007)) %
                     1000000007;
        }
      }
    }
  }
  cout << dp[n][n] << "\n";
}
