#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<short, short> P;
typedef complex<double> Point;
typedef long long ll;
const int INF = 114514810;
const int MOD = 100000007;
const double EPS = 1e-10;
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 dp[11][500][1100];
int solve(int i, int sum, int used)
{
	if (dp[i][sum][used] >= 0) return dp[i][sum][used];
	if (i == n + 1 && sum == s) return 1;
	if (i > n || sum > s) return 0;
	int res = 0;
	REP(j, 10)
	{
		if (((used >> j) & 1) == 0&&sum+i*j<=s)
		{
			res += solve(i + 1, sum + i*j, used | (1 << j));
		}
	}
	return res;
}

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

}