#include <bits/stdc++.h>

using namespace std;

#define ll long long

const int N = 303;
const int inf = (int)1e9 + 7;

int dp[N][N][N];

int mult (int a, int b) {
    return a * 1LL * b % inf;
}

int add (int a, int b) {
    a += b;
    if (a >= inf) a -= inf;
    return a;
}

int main() {
    int n, m; scanf ("%d %d", &n, &m);
    dp[0][1][1] = 1;
    for (int i = 0; i < m; i++) {
        for (int j = 1; j <= n; j++) {
            for (int l = 1; l <= n; l++) {
                int delta = dp[i][j][l];
                if (delta == 0) continue;
                dp[i + 1][j + 1][l] = add(mult(delta,(n - j)), dp[i + 1][j + 1][l]);
                dp[i + 1][j][l] = add(mult(delta, j - l),dp[i + 1][j][l]);
                dp[i + 1][j][j] = add(mult(delta, l), dp[i + 1][j][j]);
            }
        }
    }
    cout << dp[m][n][n];
}
