#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>
 
using namespace std;
 
#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

#ifdef __BORLANDC__
	typedef __int64 ll;
#else
	typedef long long ll;
#endif


const int N = 10;
int n;

typedef pair<int,int> pii;
typedef pair<pii,int> piii;

map<piii,int> memo;

int saiki(int depth, int used, int lest){
	piii key = piii(pii(depth,used),lest);
	map<piii,int>::iterator it = memo.find(key);
	if(it!=memo.end())return it->second;
	
	if(lest<0)return it->second=0;
	if(depth==n){
		if(lest==0)return it->second=1;
		return it->second=0;
	}
	
	int ret = 0;
	rep(i,N){
		if((used&(1<<i))==0){
			ret += saiki(depth+1, used|(1<<i), lest-(depth+1)*i);
		}
	}
	return it->second=ret;
}


int main(){
	int s;
	while(cin>>n>>s){
		memo.clear();
		cout<<saiki(0,0,s)<<endl;
	}
}