#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <set>
#define INF (2000000000)
#define MOD (1000000007)
using namespace std;

typedef vector<int> VI;
typedef vector<int>::iterator VII;
typedef vector<double> VD;
typedef vector<double>::iterator VDI;
typedef pair<int, int> P;


int dp[11][500][4096];

int main()
{
	dp[0][0][0] = 1;
	
	for (int i = 0; i < 10; i++){
		for (int j = 0; j < 500; j++){
			for (int k = 0; k < 2048; k++){
				for (int l = 0; l <= 9; l++){
					if (!(k & (1 << l)) && dp[i][j][k]){
						dp[i + 1][j + l * (i + 1)][k | (1 << l)] += dp[i][j][k];
					}
				}
			}
		}
	}
	
	int n, s;
	while (scanf("%d %d", &n, &s) != EOF){
		int num = 0;
		for (int i = 0; i < 4096; i++){
			num += dp[n][s][i];
		}
		printf("%d\n", num);
	}
	
	return 0;
}