#include <bits/stdc++.h>
#define rep(i,n) for(ll i = 0; i < (n); ++i)
#define srep(i,s,t) for(ll i = s; i < t; ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

const ll MOD = 1000000007;
ll dp[310][310][310]; // dp[i日目][1と強連結の数][1と強じゃない連結の数]
int main() {
    ll n, m;
    cin >> n >> m;

    rep(i,m+1)rep(j,n+1)rep(k,n+1)dp[i][j][k] = 0;

    dp[0][1][0] = 1;
    // 配るDP
    rep(i,m){
        rep(j,n+1){
            rep(k,n+1){
                if(dp[i][j][k] == 0) continue;
                if(j+k > n) continue;
                if(k == 0){
                    if(j == n){
                        dp[i+1][j][k] += dp[i][j][k] * n;
                        dp[i+1][j][k] %= MOD;
                    }else{
                        dp[i+1][j][k] += dp[i][j][k] * j;
                        dp[i+1][j][k] %= MOD;
                        dp[i+1][j][k+1] += dp[i][j][k] * (n - j);
                        dp[i+1][j][k+1] %= MOD;
                    }
                }else{
                    if(j+k == n){
                        dp[i+1][j+k][0] += dp[i][j][k] * j;
                        dp[i+1][j+k][0] %= MOD;
                        dp[i+1][j][k] += dp[i][j][k] * k;
                        dp[i+1][j][k] %= MOD;
                    }else{
                        dp[i+1][j+k][0] += dp[i][j][k] * j;
                        dp[i+1][j+k][0] %= MOD;
                        dp[i+1][j][k] += dp[i][j][k] * k;
                        dp[i+1][j][k] %= MOD;
                        dp[i+1][j][k+1] += dp[i][j][k] * (n-j-k);
                        dp[i+1][j][k+1] %= MOD;
                    }
                }
            }
        }
    }

    ll ans = dp[m][n][0];

    cout << ans << endl;
    return 0;
}


