#include <iostream>
#include <algorithm>
using namespace std;

int N, S;
int dp[1<<10][500];

int main() {
  while(cin >> N >> S) {
    if(N > 10 || S >= 500) {
      cout << 0 << endl;
      continue;
    }

    fill(dp[0], dp[1<<10], 0);
    dp[0][0] = 1;
    for(int i = 0; i < (1<<10); ++i) {
      int t = __builtin_popcount(i) + 1;
      if(t > N) continue;
      for(int j = 0; j <= S; ++j) {
        if(dp[i][j] == 0) continue;
        for(int k = 0; k < 10; ++k) {
          if(i & (1<<k)) continue;
          int ni = (i | (1<<k));
          int nj = j + k * t;
          if(nj > S) continue;
          dp[ni][nj] += dp[i][j];
        }
      }
    }
    int res = 0;
    for(int i = 0; i < (1<<10); ++i) {
      if(__builtin_popcount(i) == N) {
        res += dp[i][S];
      }
    }
    cout << res << endl;
  }
  return 0;
}