#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cstring>
#include <cctype>
#include <complex>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
using namespace std;
const int dx[]={1,0,-1,0,1,-1,-1,1};
const int dy[]={0,1,0,-1,1,1,-1,-1};
const int INF = 1<<30;
const int EPS = 1e-8;
#define PB push_back
#define fi first
#define se second
#define ll long long
#define reps(i,j,k) for(int i = (j); i < (k); i++)
#define rep(i,j) reps(i,0,j)
#define MOD 1000000007
typedef pair<int,int> Pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int > Pii;
int n,s;
int memo[1<<10][1000];
int search(int bit,int dep,int sum){
	if(dep == n && sum == s)return 1;
	if(sum > s)return 0;
	if(memo[bit][sum] != -1)return memo[bit][sum];
	int ans = 0;
	rep(i,10){
		if(!(bit>>i & 1)){
			ans += search(bit|(1<<i),dep+1,sum+i*(dep+1));
		}
	}
	return memo[bit][sum] = ans;
}
int main(){
	while(~scanf("%d%d",&n,&s)){
		memset(memo,-1,sizeof(memo));
		printf("%d\n",search(0,0,0));
	}
	return 0;
}