#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

int n, s;

int memo[11][1<<10][340];

int solve( int t, int state, int sum ) {
    if ( sum > s ) return 0;
    if ( t == n + 1 ) return sum == s;
    for ( int i = 0; i < 10; i++ ) {
        if ( state & ( 1 << i ) ) continue;
        memo[t][state][sum] += solve( t + 1, state | ( 1 << i ), sum + i * t );
    }
    return memo[t][state][sum];
}

int main() {
    bool first = true;
    while ( cin >> n >> s ) {
        if ( first ) goto solve;
        for ( int i = 0; i < 10; i++ ) {
            for ( int j = 0; j < 1024; j++ ) {
                for ( int k = 0; k < 340; k++ ) {
                    memo[i][j][k] = 0;
                }
            }
        }
    solve:;
        first = false;
        cout << solve( 1, 0, 0 ) << endl;
    }
    return 0;
}