#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <stack>
#include <queue>
#include <random>
#define INF (1<<21)
#define swap(a,b) {a=a+b; b=a-b; a=a-b;}
#define abs(a) (a > 0 ? a:-a)

using namespace std;

int rec() {
	if (choose_size == N) {
		int sum = 0;
		for (int i = 0; i < N; i++) {
			sum += (i + 1) * choose[i];
		}
		return ans == sum;
	}

	int cnt = 0;
	for (int i = 0; i < rest_size; i++) {
		choose[choose_size++] = rest[i];
		for (int j = i; j < rest_size-1; j++) {
			rest[j] = rest[j + 1];
		}
		rest_size--;
		
		cnt += rec();

		rest_size++;
		for (int j = rest_size-1; j > i; j--) {
			rest[j] = rest[j-1];
		}
		rest[i] = choose[--choose_size];
	}
	return cnt;
}

void q70() {
	int n, s;
	for (; cin >> n >> s;) {
		N = n;
		ans = s;
		choose_size = 0;
		for (int i = 0; i < MAX_N; i++) {
			rest[i] = i;
		}
		rest_size = 10;
		cout << rec() << endl;;
	}
}

int main() {
	q70();
	return 0;
}