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

int n, s;
int memo[10][1 << 10][10010];

int dfs(int now, int bit, int sum) {
  if (now >= n) return sum == s;
  if (memo[now][bit][sum] != -1) return memo[now][bit][sum];

  int ret = 0;
  for (int i = 0; i < 10; ++i) {
    if (!(bit & (1 << i))) {
      ret += dfs(now + 1, bit | (1 << i), sum + i * (now + 1));
    }
  }
  return memo[now][bit][sum] = ret;
}

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