#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][11][1024][400];

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

int main() {
    for ( int i = 0; i < 11; ++ i ) {
        for ( int j = 0; j < 11; ++ j ) {
            for ( int k = 0; k < 1024; ++ k ) {
                for ( int l = 0; l < 400; ++ l ) {
                    memo[i][j][k][l] = -1;
                }
            }
        }
    }
    while ( scanf( "%d%d", &n, &s ) != EOF ) {
        printf( "%d\n", ( n > 10 || s > 340 ) ? 0 : solve( 1, 0, s ) );
    }

    return 0;
}