#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int dp[11][1<<10][331];

int main()
{
//	cut here before submit 
//	freopen ("testcase.CNS", "r", stdin );
	memset (dp, 0, sizeof (dp ) );
	dp[0][0][0] = 1;	// dp[現在の位置][使った数字][総和]
	rep (i, 10 ){
		for (int j = 0; j < (1<<10); j++ ){
			rep (k, 10 ){
				if (j&(1<<k)) continue;
				for (int sum = 330; sum >= 0; sum-- ){
					if (sum + (i+1)*k <= 330 ){
						dp[i+1][j | (1<<k)][sum + (i+1)*k] += dp[i][j][sum];
					} // end if
				} // end for
			} // end rep
		} // end for
	} // end rep			

	int n,s;
	while (scanf ("%d %d", &n, &s ) != EOF ){
		if (n >= 11 || s > 330 ){
			cout << 0 << endl;
			continue;
		} // end if

		int total = 0;
		for (int j = 0; j < (1<<10); j++ ){
			total += dp[n][j][s];
		} // end for
		cout << total << endl;
	} // end loop
		
	return 0;
}