#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

const int MOD=1000000007;

ll dp[400][400][400];

int main(){
	int n,m;cin>>n>>m;
	dp[0][1][1]=1;
	for(int i=0;i<m;i++)rep(j,n+1)rep(k,n+1){
		ll D=dp[i][j][k];
		if(!D)continue;
		if(k+1<=n)(dp[i+1][j][k+1]+=D*(n-k))%=MOD;
		(dp[i+1][k][k]+=D*j)%=MOD;
		(dp[i+1][j][k]+=D*(k-j))%=MOD;
	}
	cout<<dp[m][n][n]<<endl;
}