#include <bits/stdc++.h>
using namespace std;

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf=1e9;
const int64_t inf64=1e18;
const double eps=1e-9;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}

void solve(){
    int n,m,mod=1000000007;
    cin >> n >> m;
    static int64_t dp[301][301][301]; //何日,行ったことのある頂点の数、強連結な頂点の数
    dp[0][1][1]=1;
    rep(i,0,m){
        rep(j,1,n+1){
            rep(k,1,j+1){
                if(j!=n) dp[i+1][j+1][k]=(dp[i+1][j+1][k]+dp[i][j][k]*(n-j)%mod)%mod;
                dp[i+1][j][k]=(dp[i+1][j][k]+dp[i][j][k]*(j-k)%mod)%mod;
                dp[i+1][j][j]=(dp[i+1][j][j]+dp[i][j][k]*k%mod)%mod;
            }
        }
    }
    cout << dp[m][n][n] << endl;
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(10);
    solve();
    return 0;
}
