#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 = 11;
int used[N];

int n,s;

int saiki(int depth, int sum){
	if(depth==n){
		if(sum==s)return 1;
		return 0;
	}
	
	int ret = 0;
	rep(i,N){
		if(used[i]==0){
			used[i]=1;
			ret += saiki(depth+1, sum+(depth+1)*i);
			used[i]=0;
		}
	}
	return ret;
}


int main(){
	while(cin>>n>>s){
		rep(i,N)used[i]=0;
		cout<<saiki(0,0)<<endl;
	}
}