#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 dp[10000][1<<11] = {0};//[i][j] = 数字がiになる　bit列jが使用済み
int main(void){

    int n,s;
    cin>>n>>s;

    dp[0][0] = 1;
    for(int i = 0;i <= s;i++){
        for(int j = 0;j < (1<<10);j++){
            if(dp[i][j]!=0){
                int bit_cnt = 1;
                for(int k = 0;k < 10;k++){
                    if(j&(1<<k))bit_cnt++;
                }
                for(int k = 0;k < 10;k++){
                    if(j&(1<<k))continue;
                    dp[i+bit_cnt*k][j+(1<<k)] += dp[i][j];
                    //if(i+bit_cnt*k<=s&&bit_cnt<=n)cout<<i<<"+"<<bit_cnt<<"*"<<k<<"  "<<dp[i][j]<<endl;
                    //if(i+bit_cnt*k==s)/*cout<<dp[i+bit_cnt*k][j+(1<<k)]<<" "<<j+(1<<k)<<endl;*/
                }
            }
        }
    }

    int ans = 0;
    for(int j = 0;j < (1<<10);j++){
        if(dp[s][j]!=0){
            int cnt = 0;
            for(int i = 9;i >= 0;i--){/*cout<<(j&(1<<i) ? 1 : 0);*/if(j&(1<<i))cnt++;}
            //cout<<endl;
            //cout<<endl<<"+"<<cnt<<" "<<dp[s][j]<<endl;
            if(cnt==n)ans += dp[s][j];
        }
    }
    cout<<ans<<endl;




    return 0;
}