#include <bits/stdc++.h>
using namespace std;

int n, s;

int dp[1 << 10][10010];

int dfs(int bit = 0, int cnt = 0, int sum = 0) {
  if (cnt == n) return s == sum;
  if (sum > s) return 0;

  int &ret = dp[bit][sum];
  if (~ret) return ret;
  ret = 0;

  for (int i = 0; i < 10; ++i) {
    if ((1 << i) & bit) continue;
    ret += dfs(bit + (1 << i), cnt + 1, sum + (cnt + 1) * i);
  }

  return ret;
}

int main() {
  while (cin >> n >> s) {
    memset(dp, -1, sizeof(dp));
    cout << dfs() << endl;
  }
}