#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 1ll<<59

int main(){
    ll i,j,k;
    ll n,m;
    cin>>n>>m;

    VVVI dp(m+1,VVI(n+2,VI(n+2,0))); //孤立j 1の成分k

    dp[0][n-1][1]=1;

    for(i=1;i<=m;i++){
        for(j=0;j<=n;j++){
            for(k=0;k<=n;k++){
                dp[i][j][k]=(j+1)*dp[i-1][j+1][k]+(n-j-k)*dp[i-1][j][k];
                if(j+k==n) {
                    for(ll l=0;l<=k;l++) dp[i][j][k]+=l*dp[i-1][j][l];
                }
                dp[i][j][k]%=Mod;
            }
        }
    }

    cout<<dp[m][0][n]<<endl;
    
    
}