#include <bits/stdc++.h>
#define pb push_back
#define int long long
#define mp make_pair
#define inf 1000000007
#define LINF 1000000000000000007LL
#define ll long long
using namespace std;
int dp[301][301][301];
signed main(){
	int n,m;
	cin>>n>>m;
	if( n > m ){
		cout<<0<<endl;
		return 0;
	}
	dp[0][1][1] = 1;
	int sum = 0;
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++){
			for(int k=1;k<=j;k++){
				dp[i][j][k] += dp[i-1][j-1][k] * (n-j+1); dp[i][j][k] %= inf;
				dp[i][j][k] += dp[i-1][j][k] * (j-k); dp[i][j][k] %= inf;
				dp[i][j][j] += dp[i-1][j][k] * k; dp[i][j][j] %= inf;
			}
			//for(int k=1;k<=j;k++){cout<<i<<j<<k<<" "<<dp[i][j][k]<<endl;}
		}
	}
	int ans = dp[m][n][n];
	cout<<ans<<endl;
	return 0;
}