import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;
import core.bitop;

int solve(immutable int n, immutable int s, immutable size_t b=(1<<10)-1)
{
    if(n<=0) return s==0?1:0;
    if(s<0) return 0;
    int c=0;
    size_t a=b;
    while(a)
    {
        auto m = bsf(a);
        c+=solve(n-1,s-n*m,b&~(1<<m));
        a&=a-1;
    }
    return c;
}

void main()
{
    foreach(s;stdin.byLine())
    {
        auto m=s.split().map!(to!int);
        writeln(solve(m[0],m[1]));
    }
}