#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <set>
#include <algorithm>
using namespace std;

#define rep(i,n) for((i)=0;(i)<(int)n;(i)++)
#define foreach(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)

int n, s, dp[12][1<<10+1][400];

int rec(int k, int S, int sum) {
  //printf("%d %d %d\n", k, S, sum);

  int i, res = 0;
  if (sum >= 331 || sum < 0) return 0;
  if (dp[k][S][sum] >= 0) return dp[k][S][sum];
  if (k == n+1) {
    if (sum == 0) {
      res = 1;
    }
  } else {
    rep(i,10) if (!((1<<i)&S)) {
      res += rec(k+1, S|(1<<i), sum - i*k);
    }
  }
  dp[k][S][sum] = res;
  return res;
}

int main() {
  int i;
  while (EOF != scanf("%d%d",&n,&s)) {
    memset(dp, -1, sizeof dp);
    printf("%d\n", rec(1, 0, s));
  }
  return 0;
}