#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

const int MOD = 1e9 + 7;
int dp[301][301];
int g[301][301];
int c[301][301];

void add(int &a, int b)
{
	a=(a+b)%MOD;
}

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

int choose(int n, int r)
{
	if(n < r) return 0;
	if(n==r) return 1;
	if(r==0) return 1;
	if(c[n][r]!=-1) return c[n][r];
	c[n][r] = (choose(n-1,r)+choose(n-1,r-1))%MOD;
	return c[n][r];
}

int ans[25][25]={{174590825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{630592107,187067364,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{317595576,491671885,817659471,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{324480512,92444956,994114427,309331349,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{612364202,116802899,655929952,661368963,303445769,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{606638382,944627578,727280267,991537326,148123070,964814732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{563336210,369607651,290127485,889172436,936492713,735520178,112937795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{165984396,799015248,486912799,521117486,624390497,322031184,265146713,848457973,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{287295458,339770185,962093194,762363875,729077145,140976536,460722256,150123933,113604679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{384095459,55760009,715981525,481478020,252873333,808236679,963601439,953207486,898925290,263728612,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{736912749,619989847,900318537,355190782,500947559,271172016,808142456,419271751,104668525,356359753,162653895,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{841336699,650390144,965212201,643981400,184324286,794130820,99248535,871118495,716429799,694600601,437902292,519013648,0,0,0,0,0,0,0,0,0,0,0,0,0},{915460741,116425131,263167234,852499824,932629769,291439485,352018860,991837283,903680319,282542980,96363218,634872862,956915940,0,0,0,0,0,0,0,0,0,0,0,0},{200447810,866843803,336257064,816399216,869688615,425493111,68784436,705073103,437292234,506005380,526155553,258162808,435171770,591788795,0,0,0,0,0,0,0,0,0,0,0},{168847690,822322199,990442845,965338085,758690839,219673342,559006232,117800826,977005274,732970604,56916417,259299217,403931348,791601213,26960558,0,0,0,0,0,0,0,0,0,0},{53694932,565474974,632731496,87433237,40749860,777187417,472922764,408655822,75935427,148132450,252492149,628149298,761221221,504194651,382911931,818561771,0,0,0,0,0,0,0,0,0},{333718454,433775776,392284604,586425273,133800537,118842784,237933901,742149287,14020917,712607117,309090797,513404204,944802463,911902547,676293805,628844839,201473695,0,0,0,0,0,0,0,0},{671190979,411157756,221752076,506736399,253244307,211618808,355592370,865448446,870704796,235043072,504228932,782675809,846912453,885068228,449255191,886593260,453010234,830318534,0,0,0,0,0,0,0},{472043415,560217649,890513263,983927030,429872845,352453370,652170639,116002887,746783651,595373235,480035844,30310993,29092107,943012501,813190598,2845321,620711807,15326392,283328761,0,0,0,0,0,0},{722770244,733283236,843562963,828996090,322003279,62468645,844308987,112588368,567020965,347587121,455670496,729890099,90455001,727161841,591706943,491333391,482810700,478017614,804614373,298655153,0,0,0,0,0},{265464467,846469384,809126640,193953925,272811087,196193135,295333441,658337820,664873884,830781062,571633371,457793337,519111943,170258576,704187233,493211829,358250091,292789599,281803950,464507895,103269519,0,0,0,0},{265130055,785589421,861464691,194965928,48038786,58370502,701227955,454591773,279659919,545523305,101074712,175351818,659551630,105883439,943223593,866999396,493874374,243076971,665031202,803322783,62113368,567777414,0,0,0},{707826504,983129028,468792681,873334323,613021790,388256934,805163219,732021698,395119496,944922719,60104912,457147310,827854937,21728025,932652273,578302941,326556120,27487804,422490643,992667534,749959766,77560945,629890782,0,0},{81161051,68074540,921370941,413896636,669494525,442956804,282722258,841893368,898248894,801147845,623662065,127982157,191537128,71712684,302889271,58094980,76023842,234024116,629507376,745775252,120279925,513159340,820613176,707451727,0},{292889442,483336561,601883495,364319970,376194737,414129045,744286295,621511302,53122839,553736497,660821287,591290851,82748073,383280748,142913151,812763976,862935195,321050299,540099358,111174191,553155194,725252985,394734880,891402805,528064896}};
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	memset(c,-1,sizeof(c));
	int n, m; cin>>n>>m;
	
	if(n>=276&&m>=276)
	{
		cout<<ans[m-276][n-276]<<'\n';
		return 0;
	}
	
	g[0][0] = 1;
	g[1][1] = 1;
	for(int i = 2; i <= m; i++) g[i][1] = 1;
	for(int j = 2; j <= n; j++)
	{
		for(int i = j; i <= m; i++)
		{
			for(int k = 1; k + j - 1 <= i; k++)
			{
				add(g[i][j], mult(g[i-k][j-1], choose(i, k)));
			}
		}
	}
	//cerr<<g[10][3]<<'\n';
	dp[0][1] = 1;
	for(int i = 0; i < m; i++)
	{
		for(int j = 1; j <= min(i+1,n); j++)
		{
			int val = dp[i][j];
			for(int l = 1; l <= m - i; l++)
			{
				for(int k = 0; k <= min(l - 1, n - j); k++)
				{
					add(dp[i+l][j+k], mult(val, mult(choose(n-j,k),mult(g[l-1][k], j))));
				}
			}
		}
	}
	cout << dp[m][n] << '\n';
}


Measured memory_bytes: 1280