#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<complex>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#include<sstream>
#include<iostream>
using namespace std;
int memo[1000][1<<11];

int n,s;
int dfs(int sum,int B,int depth){
    if(depth == n){
        if(sum == s)return 1;
        return 0;
    }
    if(memo[sum][B])return memo[sum][B];
    int bit_cnt = 0;
    int num = 0;
    for(int i = 0;i < 10;i++){
        if(B&(1<<i))continue;
        num += dfs(sum + (depth+1)*i,B+(1<<i),depth+1);
    }
    memo[sum][B] = num;
    return num;
}
int main(){

    cin>>n>>s;

    cout<<dfs(0,0,0)<<endl;


    return 0;
}