#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

int main(){
	int n,s;
	
	while(~scanf("%d %d",&n,&s)){

		int res=0;
		int num[10];
		memset(num,0,sizeof(num));
		for(int i=0;i<n;i++){
			num[i]=1;
		}

		sort(num,num+10);

		do{
			vector<int> k;
			for(int i=0;i<sizeof(num)/sizeof(int);i++){
				if(num[i]) k.push_back(i);
			}

			sort(k.begin(),k.end());

			do{
				int sum=0;
				for(int i=0;i<k.size();i++){
					sum += k[i] * (i+1);
				}
				if(sum == s) res++;
			}while(next_permutation(k.begin(),k.end()));
		}while(next_permutation(num,num+10));

		cout << res << endl;
	}
}