//0070


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


int n, s;
const int N = 10;
bool isUsed[N] = {false};

int Count(int d, int sum)
{
	if(sum == s && d == n)
		return 1;
	if(d >= n)
		return 0;

	int result = 0;

	for(int i = 0; i < N; i++)
	{
		if(!isUsed[i])
		{
			isUsed[i] = true;
			result += Count(d+1, sum + (d+1)*i);
			isUsed[i] = false;
		}
	}
	return result;
}

int main(void)
{
	while(scanf("%d %d", &n, &s) == 2)
	{
		printf("%d\n", Count(0, 0) );
	}
	return 0;
}