#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<int(n); i++)
typedef long long ll;
using namespace std;
const int mod = 1e9 + 7;
const int MAX = 310;

ll dp[MAX][MAX][MAX];

int main(){
	int N, M; cin >> N >> M;
	ll sum = 1;
	rep(j, MAX) dp[1][j][0] = 1;
	for(int sv=2; sv<MAX; sv++){
		for(int se=1; se<MAX; se++){
			for(int bv=0; bv<=sv-1; bv++){
				if(bv==0){
					if(se<sv) sum = 0;
					dp[sv][se][bv] = sum;
					sum = dp[sv][se][bv]*sv%mod;
				}else{
					dp[sv][se][bv] = (bv*dp[sv][se-1][bv] + (sv-1)*dp[sv-1][se-1][bv-1])%mod;
					sum = (sum + dp[sv][se][bv]*(sv-bv))%mod;
				}
			}
		}
	}
	cout << dp[N][M][0] << endl;
	return 0;
}
