#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 n, s;
bool used[10];
ll total[12][1000];

void dfs (int curr, int sum )
{
	if (curr == n ){
		total[n][sum]++;
		return;
	} // end if

	int res = 0;
	rep (i, 10 ){
		if (!used[i] ){
			used[i] = true;
			dfs (curr+1, sum + (curr+1)*i );
			used[i] = false;
		} // end if
	} // end rep
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.CNS", "r", stdin );

	while (scanf ("%d %d", &n, &s ) != EOF ){
		memset (used, 0, sizeof (used ) );
		memset (total, 0, sizeof (total ) );
		dfs (0, 0 );
		printf ("%d\n", total[n][s] );
	} // end loop
		
	return 0;
}