#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
int N,S;
int dp[(1<<10)][331];
int solve(int st,int s,int no){
  if(s>S) return 0;
  if(no==N+1){
    if(s==S) return 1;
    return 0;
  }
  if(dp[st][s]!=-1) return dp[st][s];
  int ret=0;
  for(int i=0;i<10;i++){
    if(!(st & (1<<i))){
      ret+=solve(st | (1<<i),s+no*i,no+1);  
    }
  }
  return dp[st][s]=ret;
}
int main(){
  while(~scanf("%d %d",&N,&S)){
    memset(dp,-1,sizeof(dp));
    printf("%d\n",solve(0,0,1));
  }
}