#include <bits/stdc++.h>

using namespace std;

const int MOD=1000000007;
int N, M;
int dp[301][301][305];

void addmod(int& x, int v)
{
    x+=v;
    if(x>=MOD)
        x-=MOD;
}

int rec(int m, int n, int l)
{
    if(m==M)
        return n==N && l==N+1;
    int& ret=dp[m][n][l];
    if(ret!=-1)
        return ret;
    ret=0;
    // last town not visit, or something before that
    addmod(ret, 1LL*rec(m+1, n, n+1)*(l-1)%MOD);
    // nothing special
    addmod(ret, 1LL*rec(m+1, n, l)*(n-l+1)%MOD);
    // new explore
    if(n<N)
        addmod(ret, 1LL*rec(m+1, n+1, l)*(N-n)%MOD);
    return ret;
}

int main()
{
    memset(dp, -1, sizeof dp);
    scanf("%d%d", &N, &M);
    int ans=rec(0, 1, 2);
    printf("%d\n", ans);
    return 0;
}
