//0070


#include<stdio.h>
#include<map>
#include<algorithm>
using namespace std;



//±ê¾Æ5bÅÔØê
int n, s;
const int N = 10;
const int MAX_SUM = 450;	//0*1+1*2+...+9*10ÌlA·Èí¿¦ÌÅål
int memo[N+1][MAX_SUM+1];	//¦ð·éàÌ
const int INVALID_VALUE = -1;
bool isUsed[N] = {false};

int Count(int d, int sum)
{
	if(memo[d][sum] != INVALID_VALUE)
		return memo[d][sum];	//ª Á½çAé

	if(sum == s && d == n)
		return 1;
	if(d >= n || sum >= s)
		return 0;

	int result = 0;

	for(int i = 0; i < N; i++)
	{
		if(!isUsed[i])
		{
			isUsed[i] = true;
			result += Count(d+1, sum + (n-d)*i);	//å«¢a©çâÁÄÁ½Ù¤ª¬¢ñ¶áÈ¢H
			isUsed[i] = false;
		}
	}
	memo[d][sum] = result;	//ðüêé
	return result;
}

int main(void)
{
	int i, j;
	while(scanf("%d %d", &n, &s) == 2)
	{
			for(i = 0; i < sizeof(memo)/sizeof(memo[0]); i++)
				for(j = 0; j < sizeof(memo[0])/sizeof(memo[0][0]); j++)
					memo[i][j] = INVALID_VALUE;
		printf("%d\n", Count(0, 0) );
	}
	return 0;
}


#if 0
//±ê¾Æ4b©©ÁÄÔØê
int f(const int a[], int size)
{
	int result = 0;
	for(int i = 0; i < size; i++)
	{
		result = result*10 + a[i];
	}
	return result;
}
int main(void)
{
	int n, s, i, t;
	const int N = 10;
	map<int, int> m;
	while(scanf("%d %d", &n, &s) == 2)
	{
		m.clear();
		int a[N] = {0,1,2,3,4,5,6,7,8,9,};
		do
		{
			t = 0;
			for(i = 0; i < n; i++)
			{
				t += (i+1) * a[i];
			}
			if(t == s)
				m[f(a, n)] = t;
		}while( next_permutation(a, a+N) );
		printf("%d\n", m.size());
	}
	return 0;
}
#endif