#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <chrono>
#include <ctime>
#include <bitset>
#include <iterator>
#include <cmath>
#include <stack>
#include <random>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using namespace std;
using ll = long long;
using P = pair<int, int>;

constexpr ll mod = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

ll dp[301][301][301];

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int n, m; cin >> n >> m;

  rep(i, 301) {
    rep(j, 301) {
      rep(k, 301) {
        // j: satisfy, k: moved (1 <= j <= k <= n)
        dp[i][j][k] = 0;
      }
    }
  }

  dp[0][1][1] = 1;
  rep(i, m) {
    for(int j=1; j<=n; j++) {
      for(int k=1; k<=n; k++) {
        dp[i+1][j][k] += dp[i][j][k]*(k-j);
        dp[i+1][j][k] %= mod;
        dp[i+1][j][k+1] += dp[i][j][k]*(n-k);
        dp[i+1][j][k] %= mod;
        dp[i+1][k][k] += dp[i][j][k]*j;
        dp[i+1][k][k] %= mod;
      }
    }
  }
  cout << dp[m][n][n] << endl;
}