#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>

using namespace std;
typedef long long LL;
typedef pair<int, int> P;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
int n,s;
int memo[10][350];
int dfs(int i, int sum, bool k[10]){
  if(i==n){
    if(sum==s) return 1;
    else return 0;
  }
  if(sum>s) return 0;
  int ret=0;
  REP(j,10)if((!k[j])&&(sum+(i+1)*j<=s)){
    bool k2[10];
    REP(h,10) k2[h] = k[h];
    k2[j] = true;
    ret+=dfs(i+1,sum+(i+1)*j,k2);
  }
  return ret;
}
int dp[11][250][11];
int main(void){
  while(cin>>n>>s){
    bool k[10];
    memset(k,0,sizeof(k));
    memset(memo,-1,sizeof(memo));
    cout<<dfs(0,0,k)<<endl;
    /*
    memset(dp,0,sizeof(dp));
    for(int i=0; i<10; i++){
      for(int j=0; j<=10; j++){
        dp[1][i][j] = (i==j)?0:1;
      }
    }
    for(int i=2; i<=n; i++){
      for(int j=0; j<=s; j++){
        for(int k=0; j-i*k>=0&&k<10; k++){
          for(int l=0; l<=10; l++){
            dp[i][j][l] += (k==l)?0:dp[i-1][j-i*k][k];
          }
        }
      }
    }
    cout<<dp[n][s][10]<<endl;
    */
  }
  return 0;
}