#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(5)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef complex<double> Point;
typedef long long ll;
const int INF = 114514810;
const int MOD = 1000000007;
const double EPS = 1e-8;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

int n, s;
int memo[11][800][1 << 10];

int solve(int i, int j, int v)
{
	if (memo[i][j][v] >= 0) return memo[i][j][v];
	if (i == n)
	{
		if (j == s) return 1;
		else return 0;
	}

	int res = 0;
	REP(k, 10)
	{
		if ((v >> k) & 1) continue;
		if (j + k*(i + 1) > s) break;
		res += solve(i + 1, j + (i + 1)*k, v | (1 << k));
	}
	return memo[i][j][v] = res;
}

int main()
{
	while (cin >> n >> s)
	{
		MS(memo, -1);
		cout << solve(0, 0, 0) << endl;
	}
	return 0;
}