#include <bits/stdc++.h>
using namespace std;
#define int long long
#define p (int)(1e9 + 7)

int MOD(int a){
	return (a %= p) >= 0 ? a : a + p;
}

int fact(int N){
	if(N == 0){
		return 1;
	}
	else{
		return MOD(N * fact(N - 1));
	}
}

signed main(){
	int N, M, i, j, k;
	scanf("%lld%lld", &N, &M);
	vector<vector<vector<int>>> dp(M + 1, vector<vector<int>>(N, vector<int>(N, 0)));
	dp[0][0][0] = 1;
	for(i = 0; i < M; i++){
		for(j = 0; j < N; j++){
			for(k = 0; k < N; k++){
//				printf("dp[%lld, %lld, %lld] = %lld\n", i, j, k, dp[i][j][k]);
				dp[i + 1][j][j] = MOD(dp[i + 1][j][j] + (k + 1) * dp[i][j][k]);
				if(k < j){
					dp[i + 1][j][k] = MOD(dp[i + 1][j][k] + (j - k) * dp[i][j][k]);
				}
				if(j < N - 1){
					dp[i + 1][j + 1][k] = MOD(dp[i + 1][j + 1][k] + dp[i][j][k]);
				}
			}
		}
	}
	printf("%lld\n", MOD(dp[M][N - 1][N - 1] * fact(N - 1)));
	return 0;
}