#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation etc.
#include <cstdlib>	// require abs
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <fstream>	// require freopen

using namespace std;

int comb[1<<10][330+1];

void disp_t (void )
{
	int i,j;

	for (i = 0; i < (1 << 10); ++i){
		for (j = 0; j <= 10; ++j){
			cout << comb[i][j] << ' ';
		} // end for
		cout << endl;
	} // end for
}

int bitCount (int n )
{
	int res = 0;

	for (int i = 0 ; i < 32; ++i ) {
		if ( n & (1 << i ) ) {
			++res;
		} // end if
	} // end for

	return res;
}

string printbin (int n )
{
	string res = "";

	while (n > 0 ){
		if (n % 2 == 0 ){
			res += '0';
		}else{
			res += '1';
		} // end if
		n /= 2;
	} // end while

	if (res.size() != 10 ){
		res += string (10 - res.size(), '0' );
	} // end if

	reverse (res.begin(), res.end() );

	return res;
}


void make_table (int n )
{
	int i, j, k;
	memset (comb, 0, sizeof (comb ) );

	for (i = 0; i < (1 << 10); ++i ) {
		vector <int> c;
		for (j = 0; j < 10; ++j){
			if ( (i & (1 << j ) ) && (n == bitCount (i) ) ) {
				c.push_back (j );
			} // end if
		} // end for

		if (!c.empty() ) {
//			sort (c.begin(), c.end() );

			do{
				int sum = 0;
				for (int k = 0; k < n; ++k ) {
					sum += (k+1)*c[k];
				} // end for
				++comb[i][sum];
			}while (next_permutation (c.begin(), c.end() ) );
		} // end if	
	} // end for
}

int sum_s (int s )
{
	int res = 0;

	for (int i = 0; i < (1 << 10 ); ++i ) {
		res += comb[i][s];
	} // end for

	return res;
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.comb2", "r", stdin) ;
	
	int n, s;
	while (cin >> n >> s ){
		make_table (n );
//		disp_t ();
		int res = sum_s (s );
		cout << res << endl;
	} // end while
			
	return 0;
}