#include<iostream>
#include<cstring>
using namespace std;
int n,s;
long long int dp[1<<11][10][250];

long long int check(int bit,int now,int sum)
{
  //cout<<bit<<" "<<now<<" "<<sum<<endl;
  if(s==sum && n==now)
    {
      //   cout<<bit<<" "<<now<<" "<<sum<<endl;      
      return 1;
    }
  if(n<now)
    return 0;
  if(s<=sum)
    {
      if ((bit&1)==0)
	return check(bit|1,now+1,sum);
      else
	return 0; 
    }
  if(dp[bit][now][sum]!=-1)
    return dp[bit][now][sum];
  long long int ans=0;
  for(int i=0;i<10;i++)
    {
      if((bit & (1<<i))==0)
	ans+=check(bit|(1<<i),now+1,sum+(i*(now+1)));      
    }
  dp[bit][now][sum]=ans;
  return ans; 
}

int main()
{
  
  //  cout<<(1<<1 | 1<<2)<<endl;
  for(;cin>>n>>s;)
    {
      memset(dp,-1,sizeof(dp));
      cout<<check(0,0,0)<<endl;
    }
}